- Timestamp:
- 03/07/10 22:04:34 (15 years ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/common.c
r171 r172 310 310 return NULL; 311 311 } 312 313 314 static char* get_quoted_keyname(const REGFI_NK_REC* nk) 315 { 316 char* ret_val; 317 318 if(nk->keyname == NULL) 319 ret_val = quote_buffer(nk->keyname_raw, nk->name_length, key_special_chars); 320 else 321 ret_val = quote_string(nk->keyname, key_special_chars); 322 323 return ret_val; 324 } 325 326 327 static char* get_quoted_valuename(const REGFI_VK_REC* vk) 328 { 329 char* ret_val; 330 331 if(vk->valuename == NULL) 332 ret_val = quote_buffer(vk->valuename_raw, vk->name_length, 333 key_special_chars); 334 else 335 ret_val = quote_string(vk->valuename, key_special_chars); 336 337 return ret_val; 338 } -
trunk/src/reglookup-recover.c
r168 r172 79 79 strftime(mtime, sizeof(mtime), "%Y-%m-%d %H:%M:%S", tmp_time_s); 80 80 81 quoted_name = quote_string(nk->keyname, key_special_chars); 81 /* XXX: Add command line option to choose output encoding */ 82 regfi_interpret_keyname(f, nk, REGFI_ENCODING_ASCII, true); 83 84 quoted_name = get_quoted_keyname(nk); 82 85 if (quoted_name == NULL) 83 86 { … … 104 107 105 108 106 void printValue(REGFI_FILE* f, constREGFI_VK_REC* vk, const char* prefix)109 void printValue(REGFI_FILE* f, REGFI_VK_REC* vk, const char* prefix) 107 110 { 108 111 char* quoted_value = NULL; … … 112 115 const char* str_type = NULL; 113 116 114 quoted_name = quote_string(vk->valuename, key_special_chars); 117 /* XXX: Add command line option to choose output encoding */ 118 regfi_interpret_valuename(f, vk, REGFI_ENCODING_ASCII, true); 119 120 quoted_name = get_quoted_valuename(vk); 115 121 if (quoted_name == NULL) 116 122 { /* Value names are NULL when we're looking at the "(default)" value. … … 120 126 * this value. 121 127 */ 122 quoted_name = malloc(1*sizeof(char));128 quoted_name = strdup(""); 123 129 if(quoted_name == NULL) 124 130 bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n"); 125 quoted_name[0] = '\0';126 } 131 } 132 127 133 /* XXX: Add command line option to choose output encoding */ 128 134 if(vk->data != NULL … … 278 284 path_element = talloc(path_stack, REGFI_BUFFER); 279 285 if(path_element != NULL) 280 path_element->buf = (uint8_t*)quote_string(cur_ancestor->keyname, 281 key_special_chars); 286 { 287 /* XXX: Add command line option to choose output encoding */ 288 regfi_interpret_keyname(f, cur_ancestor, REGFI_ENCODING_ASCII, true); 282 289 290 path_element->buf = (uint8_t*)get_quoted_keyname(cur_ancestor); 291 } 292 283 293 if(path_element == NULL || path_element->buf == NULL 284 294 || !void_stack_push(path_stack, path_element)) … … 929 939 if(tmp_key->num_values > 0 && tmp_key->values != NULL) 930 940 { 931 tmp_name = quote_string(tmp_key->keyname, key_special_chars); 941 /* XXX: Add command line option to choose output encoding */ 942 regfi_interpret_keyname(f, tmp_key, REGFI_ENCODING_ASCII, true); 943 944 tmp_name = get_quoted_keyname(tmp_key); 932 945 tmp_path = (char*)malloc(strlen(parent_paths[i])+strlen(tmp_name)+2); 933 946 if(tmp_path == NULL) -
trunk/src/reglookup.c
r170 r172 63 63 struct tm* tmp_time_s = NULL; 64 64 65 if(vk->valuename == NULL) 66 quoted_name = quote_buffer(vk->valuename_raw, vk->name_length, 67 key_special_chars); 68 else 69 quoted_name = quote_string(vk->valuename, key_special_chars); 65 quoted_name = get_quoted_valuename(vk); 70 66 if (quoted_name == NULL) 71 67 { /* Value names are NULL when we're looking at the "(default)" value. … … 248 244 tmp_key = cur->nk; 249 245 250 if(tmp_key->keyname == NULL) 251 name = quote_buffer(i->cur_key->keyname_raw, i->cur_key->name_length, 252 key_special_chars); 253 else 254 name = quote_string(tmp_key->keyname, key_special_chars); 246 name = get_quoted_keyname(tmp_key); 255 247 256 248 buf[buf_len-buf_left-1] = '/';
Note: See TracChangeset
for help on using the changeset viewer.