Ignore:
Timestamp:
03/07/10 22:04:34 (14 years ago)
Author:
tim
Message:

reorganized name interpretation code to correct issues in reglookup-recover

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup-recover.c

    r168 r172  
    7979  strftime(mtime, sizeof(mtime), "%Y-%m-%d %H:%M:%S", tmp_time_s);
    8080
    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);
    8285  if (quoted_name == NULL)
    8386  {
     
    104107
    105108
    106 void printValue(REGFI_FILE* f, const REGFI_VK_REC* vk, const char* prefix)
     109void printValue(REGFI_FILE* f, REGFI_VK_REC* vk, const char* prefix)
    107110{
    108111  char* quoted_value = NULL;
     
    112115  const char* str_type = NULL;
    113116
    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);
    115121  if (quoted_name == NULL)
    116122  { /* Value names are NULL when we're looking at the "(default)" value.
     
    120126     * this value.
    121127     */
    122     quoted_name = malloc(1*sizeof(char));
     128    quoted_name = strdup("");
    123129    if(quoted_name == NULL)
    124130      bailOut(REGLOOKUP_EXIT_OSERR, "ERROR: Could not allocate sufficient memory.\n");
    125     quoted_name[0] = '\0';
    126   }
     131  }
     132
    127133  /* XXX: Add command line option to choose output encoding */
    128134  if(vk->data != NULL
     
    278284        path_element = talloc(path_stack, REGFI_BUFFER);
    279285        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);
    282289         
     290          path_element->buf = (uint8_t*)get_quoted_keyname(cur_ancestor);
     291        }
     292 
    283293        if(path_element == NULL || path_element->buf == NULL
    284294           || !void_stack_push(path_stack, path_element))
     
    929939    if(tmp_key->num_values > 0 && tmp_key->values != NULL)
    930940    {
    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);
    932945      tmp_path = (char*)malloc(strlen(parent_paths[i])+strlen(tmp_name)+2);
    933946      if(tmp_path == NULL)
Note: See TracChangeset for help on using the changeset viewer.