diff options
author | Michael Adam <obnox@samba.org> | 2009-05-06 02:08:33 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-05-06 02:26:26 +0200 |
commit | 4842e45d59dbd6c9ac138e796d30fcf747807d1c (patch) | |
tree | e2c57f746611640660b24a83794cd82b4c3e2868 /source3 | |
parent | 3242c6caf751423a690a011a49a31dee445bf63b (diff) | |
download | samba-4842e45d59dbd6c9ac138e796d30fcf747807d1c.tar.gz samba-4842e45d59dbd6c9ac138e796d30fcf747807d1c.tar.bz2 samba-4842e45d59dbd6c9ac138e796d30fcf747807d1c.zip |
s3:loadparm: handle registry config source in file_list - fixes bug #6320
Michael
Diffstat (limited to 'source3')
-rw-r--r-- | source3/param/loadparm.c | 78 |
1 files changed, 44 insertions, 34 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 670746e913..6dd8dbc9ce 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -682,6 +682,8 @@ static void set_allowed_client_auth(void); static void *lp_local_ptr(struct service *service, void *ptr); +static void add_to_file_list(const char *fname, const char *subfname); + static const struct enum_list enum_protocol[] = { {PROTOCOL_NT1, "NT1"}, {PROTOCOL_LANMAN2, "LANMAN2"}, @@ -6875,6 +6877,8 @@ static bool process_registry_globals(void) { bool ret; + add_to_file_list(INCLUDE_REGISTRY_NAME, INCLUDE_REGISTRY_NAME); + ret = do_parameter("registry shares", "yes", NULL); if (!ret) { return ret; @@ -6998,45 +7002,51 @@ bool lp_file_list_changed(void) DEBUG(6, ("lp_file_list_changed()\n")); - if (lp_config_backend_is_registry()) { - struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); - - if (conf_ctx == NULL) { - return false; - } - if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, NULL)) { - DEBUGADD(6, ("registry config changed\n")); - return true; - } - } - while (f) { char *n2 = NULL; time_t mod_time; - n2 = alloc_sub_basic(get_current_username(), - current_user_info.domain, - f->name); - if (!n2) { - return false; - } - DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", - f->name, n2, ctime(&f->modtime))); - - mod_time = file_modtime(n2); - - if (mod_time && ((f->modtime != mod_time) || (f->subfname == NULL) || (strcmp(n2, f->subfname) != 0))) { - DEBUGADD(6, - ("file %s modified: %s\n", n2, - ctime(&mod_time))); - f->modtime = mod_time; - SAFE_FREE(f->subfname); - f->subfname = n2; /* Passing ownership of - return from alloc_sub_basic - above. */ - return true; + if (strequal(f->name, INCLUDE_REGISTRY_NAME)) { + struct smbconf_ctx *conf_ctx = lp_smbconf_ctx(); + + if (conf_ctx == NULL) { + return false; + } + if (smbconf_changed(conf_ctx, &conf_last_csn, NULL, + NULL)) + { + DEBUGADD(6, ("registry config changed\n")); + return true; + } + } else { + n2 = alloc_sub_basic(get_current_username(), + current_user_info.domain, + f->name); + if (!n2) { + return false; + } + DEBUGADD(6, ("file %s -> %s last mod_time: %s\n", + f->name, n2, ctime(&f->modtime))); + + mod_time = file_modtime(n2); + + if (mod_time && + ((f->modtime != mod_time) || + (f->subfname == NULL) || + (strcmp(n2, f->subfname) != 0))) + { + DEBUGADD(6, + ("file %s modified: %s\n", n2, + ctime(&mod_time))); + f->modtime = mod_time; + SAFE_FREE(f->subfname); + f->subfname = n2; /* Passing ownership of + return from alloc_sub_basic + above. */ + return true; + } + SAFE_FREE(n2); } - SAFE_FREE(n2); f = f->next; } return (False); |