Changeset 109 for trunk/src/reglookup.c


Ignore:
Timestamp:
04/29/08 16:38:27 (16 years ago)
Author:
tim
Message:

reworked SK record caching to prevent unnecessary loads.

SK records now cached in iterators on an as-needed basis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/reglookup.c

    r107 r109  
    4444
    4545/* Other globals */
     46REGF_FILE* f;
    4647const char* key_special_chars = ",\"\\/";
    4748const char* subfield_special_chars = ",\"\\|";
     
    621622
    622623
    623 void printKey(const REGF_NK_REC* k, char* full_path)
     624void printKey(REGFI_ITERATOR* i, char* full_path)
    624625{
    625626  static char empty_str[1] = "";
     
    631632  time_t tmp_time[1];
    632633  struct tm* tmp_time_s = NULL;
     634  const REGF_SK_REC* sk;
     635  const REGF_NK_REC* k = regfi_iterator_cur_key(i);
    633636
    634637  *tmp_time = nt_time_to_unix(&k->mtime);
     
    636639  strftime(mtime, sizeof(mtime), "%Y-%m-%d %H:%M:%S", tmp_time_s);
    637640
    638   if(print_security)
    639   {
    640     owner = regfi_get_owner(k->sec_desc->sec_desc);
    641     group = regfi_get_group(k->sec_desc->sec_desc);
    642     sacl = regfi_get_sacl(k->sec_desc->sec_desc);
    643     dacl = regfi_get_dacl(k->sec_desc->sec_desc);
     641  if(print_security && (sk=regfi_iterator_cur_sk(i)))
     642  {
     643    owner = regfi_get_owner(sk->sec_desc);
     644    group = regfi_get_group(sk->sec_desc);
     645    sacl = regfi_get_sacl(sk->sec_desc);
     646    dacl = regfi_get_dacl(sk->sec_desc);
    644647    if(owner == NULL)
    645648      owner = empty_str;
     
    692695     
    693696      if(!type_filter_enabled || (key_type == type_filter))
    694         printKey(cur, path);
     697        printKey(iter, path);
    695698      if(!type_filter_enabled || (key_type != type_filter))
    696699        printValueList(iter, path);
     
    838841{
    839842  char** path = NULL;
    840   REGF_FILE* f;
    841843  REGFI_ITERATOR* iter;
    842844  int retr_path_ret;
Note: See TracChangeset for help on using the changeset viewer.