Changeset 274 for branches/samba-3.3.x/source/param
- Timestamp:
- Jun 17, 2009, 2:19:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/samba-3.3.x/source/param/loadparm.c
r239 r274 671 671 static void set_allowed_client_auth(void); 672 672 673 static void add_to_file_list(const char *fname, const char *subfname); 674 673 675 static const struct enum_list enum_protocol[] = { 674 676 {PROTOCOL_NT1, "NT1"}, … … 6615 6617 } 6616 6618 } 6619 if (iServiceIndex >= 0) { 6620 return service_ok(iServiceIndex); 6621 } 6617 6622 return true; 6618 6623 } … … 6632 6637 goto done; 6633 6638 } 6639 6640 add_to_file_list(INCLUDE_REGISTRY_NAME, INCLUDE_REGISTRY_NAME); 6634 6641 6635 6642 ret = do_parameter("registry shares", "yes", NULL); … … 6701 6708 return ret; 6702 6709 } 6710 6711 #define MAX_INCLUDE_DEPTH 100 6712 6713 static uint8_t include_depth; 6703 6714 6704 6715 static struct file_lists { … … 6774 6785 DEBUG(6, ("lp_file_list_changed()\n")); 6775 6786 6776 if (lp_config_backend_is_registry()) {6777 struct smbconf_ctx *conf_ctx = lp_smbconf_ctx();6778 6779 if (conf_ctx == NULL) {6780 return false;6781 }6782 if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL)) {6783 DEBUGADD(6, ("registry config changed\n"));6784 return true;6785 }6786 }6787 6788 6787 while (f) { 6789 6788 char *n2 = NULL; 6790 6789 time_t mod_time; 6791 6790 6792 n2 = alloc_sub_basic(get_current_username(), 6793 current_user_info.domain, 6794 f->name); 6795 if (!n2) { 6796 return false; 6791 if (strequal(f->name, INCLUDE_REGISTRY_NAME)) { 6792 struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); 6793 6794 if (conf_ctx == NULL) { 6795 return false; 6796 } 6797 if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, 6798 NULL)) 6799 { 6800 DEBUGADD(6, ("registry config changed\n")); 6801 return true; 6802 } 6803 } else { 6804 n2 = alloc_sub_basic(get_current_username(), 6805 current_user_info.domain, 6806 f->name); 6807 if (!n2) { 6808 return false; 6809 } 6810 DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", 6811 f->name, n2, ctime(&f->modtime))); 6812 6813 mod_time = file_modtime(n2); 6814 6815 if (mod_time && 6816 ((f->modtime != mod_time) || 6817 (f->subfname == NULL) || 6818 (strcmp(n2, f->subfname) != 0))) 6819 { 6820 DEBUGADD(6, 6821 ("file %s modified: %s\n", n2, 6822 ctime(&mod_time))); 6823 f->modtime = mod_time; 6824 SAFE_FREE(f->subfname); 6825 f->subfname = n2; /* Passing ownership of 6826 return from alloc_sub_basic 6827 above. */ 6828 return true; 6829 } 6830 SAFE_FREE(n2); 6797 6831 } 6798 DEBUGADD(6, ("file %s -> %s last mod_time: %s\n",6799 f->name, n2, ctime(&f->modtime)));6800 6801 mod_time = file_modtime(n2);6802 6803 if (mod_time && ((f->modtime != mod_time) || (f->subfname == NULL) || (strcmp(n2, f->subfname) != 0))) {6804 DEBUGADD(6,6805 ("file %s modified: %s\n", n2,6806 ctime(&mod_time)));6807 f->modtime = mod_time;6808 SAFE_FREE(f->subfname);6809 f->subfname = n2; /* Passing ownership of6810 return from alloc_sub_basic6811 above. */6812 return true;6813 }6814 SAFE_FREE(n2);6815 6832 f = f->next; 6816 6833 } … … 6889 6906 char *fname; 6890 6907 6908 if (include_depth >= MAX_INCLUDE_DEPTH) { 6909 DEBUG(0, ("Error: Maximum include depth (%u) exceeded!\n", 6910 include_depth)); 6911 return false; 6912 } 6913 6891 6914 if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) { 6892 6915 if (!bAllowIncludeRegistry) { … … 6894 6917 } 6895 6918 if (bInGlobalSection) { 6896 return process_registry_globals(); 6919 bool ret; 6920 include_depth++; 6921 ret = process_registry_globals(); 6922 include_depth--; 6923 return ret; 6897 6924 } else { 6898 6925 DEBUG(1, ("\"include = registry\" only effective " … … 6911 6938 6912 6939 if (file_exist(fname, NULL)) { 6913 bool ret = pm_process(fname, do_section, do_parameter, NULL); 6940 bool ret; 6941 include_depth++; 6942 ret = pm_process(fname, do_section, do_parameter, NULL); 6943 include_depth--; 6914 6944 SAFE_FREE(fname); 6915 6945 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.