- Timestamp:
- 01/15/07 10:22:47 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/reglookup.c
r77 r78 216 216 { 217 217 tmp_err = strerror(-ret_err); 218 str_type = regfi o_type_val2str(type);218 str_type = regfi_type_val2str(type); 219 219 *error_msg = (char*)malloc(65+strlen(str_type)+strlen(tmp_err)+1); 220 220 if(*error_msg == NULL) … … 385 385 { 386 386 void_stack* ret_val; 387 void_stack* rev_ret = void_stack_new( 1024);387 void_stack* rev_ret = void_stack_new(REGF_MAX_DEPTH); 388 388 const char* cur = s; 389 389 char* next = NULL; … … 405 405 memcpy(copy, cur, next-cur); 406 406 copy[next-cur] = '\0'; 407 void_stack_push(rev_ret, copy); 407 if(!void_stack_push(rev_ret, copy)) 408 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 408 409 } 409 410 cur = next+1; … … 412 413 { 413 414 copy = strdup(cur); 414 void_stack_push(rev_ret, copy); 415 if(!void_stack_push(rev_ret, copy)) 416 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 415 417 } 416 418 … … 541 543 "warning returned: %s\n", prefix, quoted_name, conv_error); 542 544 543 str_type = regfi o_type_val2str(vk->type);545 str_type = regfi_type_val2str(vk->type); 544 546 if(print_security) 545 547 { … … 597 599 if(print_security) 598 600 { 599 owner = regfi o_get_owner(k->sec_desc->sec_desc);600 group = regfi o_get_group(k->sec_desc->sec_desc);601 sacl = regfi o_get_sacl(k->sec_desc->sec_desc);602 dacl = regfi o_get_dacl(k->sec_desc->sec_desc);601 owner = regfi_get_owner(k->sec_desc->sec_desc); 602 group = regfi_get_group(k->sec_desc->sec_desc); 603 sacl = regfi_get_sacl(k->sec_desc->sec_desc); 604 dacl = regfi_get_dacl(k->sec_desc->sec_desc); 603 605 if(owner == NULL) 604 606 owner = empty_str; … … 636 638 uint32 path_len = 0; 637 639 uint32 prefix_len = strlen(prefix); 638 int key_type = regfi o_type_str2val("KEY");640 int key_type = regfi_type_str2val("KEY"); 639 641 640 642 if((cur = (REGF_NK_REC*)void_stack_cur(nk_stack)) != NULL) … … 672 674 while((cur = (REGF_NK_REC*)void_stack_cur(nk_stack)) != NULL) 673 675 { 674 if((sub = regfi o_fetch_subkey(f, cur)) == NULL)676 if((sub = regfi_fetch_subkey(f, cur)) == NULL) 675 677 { 676 678 sub = void_stack_pop(nk_stack); … … 684 686 { 685 687 sub->subkey_index = 0; 686 void_stack_push(nk_stack, sub); 688 if(!void_stack_push(nk_stack, sub)) 689 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 687 690 path = stack2Path(nk_stack); 688 691 if(path != NULL) … … 753 756 found_cur = false; 754 757 while(!found_cur && 755 (sub = regfi o_fetch_subkey(f, cur)) != NULL)758 (sub = regfi_fetch_subkey(f, cur)) != NULL) 756 759 { 757 760 if(strcasecmp(sub->keyname, cur_str) == 0) 758 761 { 759 762 cur = sub; 760 void_stack_push(nk_stack, sub); 763 if(!void_stack_push(nk_stack, sub)) 764 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 765 761 766 found_cur = true; 762 767 } … … 802 807 " of specified path.\n"); 803 808 804 while((sub = regfi o_fetch_subkey(f, cur)) != NULL)809 while((sub = regfi_fetch_subkey(f, cur)) != NULL) 805 810 { 806 811 if(strcasecmp(sub->keyname, cur_str) == 0) 807 812 { 808 sub_nk_stack = void_stack_new(1024); 809 void_stack_push(sub_nk_stack, sub); 813 sub_nk_stack = void_stack_new(REGF_MAX_DEPTH); 814 if(!void_stack_push(sub_nk_stack, sub)) 815 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 810 816 prefix = stack2Path(nk_stack); 811 817 prefix_len = strlen(prefix); … … 890 896 bailOut(1, "ERROR: '-t' option requires parameter.\n"); 891 897 } 892 if((type_filter = regfi o_type_str2val(argv[argi])) < 0)898 if((type_filter = regfi_type_str2val(argv[argi])) < 0) 893 899 { 894 900 fprintf(stderr, "ERROR: Invalid type specified: %s.\n", argv[argi]); … … 917 923 bailOut(2, "ERROR: Memory allocation problem.\n"); 918 924 919 f = regfi o_open(registry_file);925 f = regfi_open(registry_file); 920 926 if(f == NULL) 921 927 { … … 924 930 } 925 931 926 root = regfi o_rootkey(f);927 nk_stack = void_stack_new( 1024);932 root = regfi_rootkey(f); 933 nk_stack = void_stack_new(REGF_MAX_DEPTH); 928 934 929 935 if(void_stack_push(nk_stack, root)) … … 950 956 } 951 957 else 952 bailOut(2, "ERROR: Memory allocation problem.\n");958 bailOut(2, "ERROR: Registry maximum depth exceeded.\n"); 953 959 954 960 void_stack_destroy_deep(nk_stack); 955 regfi o_close(f);961 regfi_close(f); 956 962 957 963 return 0;
Note: See TracChangeset
for help on using the changeset viewer.