Ignore:
Timestamp:
Jun 17, 2009, 2:19:52 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

Update 3.3 branch to 3.3.5

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.3.x/source/param/loadparm.c

    r239 r274  
    671671static void set_allowed_client_auth(void);
    672672
     673static void add_to_file_list(const char *fname, const char *subfname);
     674
    673675static const struct enum_list enum_protocol[] = {
    674676        {PROTOCOL_NT1, "NT1"},
     
    66156617                }
    66166618        }
     6619        if (iServiceIndex >= 0) {
     6620                return  service_ok(iServiceIndex);
     6621        }
    66176622        return true;
    66186623}
     
    66326637                goto done;
    66336638        }
     6639
     6640        add_to_file_list(INCLUDE_REGISTRY_NAME, INCLUDE_REGISTRY_NAME);
    66346641
    66356642        ret = do_parameter("registry shares", "yes", NULL);
     
    67016708        return ret;
    67026709}
     6710
     6711#define MAX_INCLUDE_DEPTH 100
     6712
     6713static uint8_t include_depth;
    67036714
    67046715static struct file_lists {
     
    67746785        DEBUG(6, ("lp_file_list_changed()\n"));
    67756786
    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 
    67886787        while (f) {
    67896788                char *n2 = NULL;
    67906789                time_t mod_time;
    67916790
    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);
    67976831                }
    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 of
    6810                                              return from alloc_sub_basic
    6811                                              above. */
    6812                         return true;
    6813                 }
    6814                 SAFE_FREE(n2);
    68156832                f = f->next;
    68166833        }
     
    68896906        char *fname;
    68906907
     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
    68916914        if (strequal(pszParmValue, INCLUDE_REGISTRY_NAME)) {
    68926915                if (!bAllowIncludeRegistry) {
     
    68946917                }
    68956918                if (bInGlobalSection) {
    6896                         return process_registry_globals();
     6919                        bool ret;
     6920                        include_depth++;
     6921                        ret = process_registry_globals();
     6922                        include_depth--;
     6923                        return ret;
    68976924                } else {
    68986925                        DEBUG(1, ("\"include = registry\" only effective "
     
    69116938
    69126939        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--;
    69146944                SAFE_FREE(fname);
    69156945                return ret;
Note: See TracChangeset for help on using the changeset viewer.