From 81afd9e36391faaefe89bbe36550904254f61511 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jul 2011 10:10:43 +0200 Subject: [PATCH 1/2] s3:loadparm: add reload_registry_shares() - reload only those shares already loaded (cherry picked from commit ec113a58a4dc4e4f3ea03f7818eb312325f69482) --- source3/param/loadparm.c | 29 +++++++++++++++++++++++++++++ 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 0a1a4b0..ed01c9b 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7351,6 +7351,35 @@ done: return ret; } +/** + * reload those shares from registry that are already + * activated in the services array. + */ +static bool reload_registry_shares(void) +{ + int i; + bool ret = true; + + for (i = 0; i < iNumServices; i++) { + if (!VALID(i)) { + continue; + } + + if (ServicePtrs[i]->usershare == USERSHARE_VALID) { + continue; + } + + ret = process_registry_service(ServicePtrs[i]->szService); + if (!ret) { + goto done; + } + } + +done: + return ret; +} + + #define MAX_INCLUDE_DEPTH 100 static uint8_t include_depth; -- 1.7.1 From 6aaa2e708ec7e01d5cffa02ea7552ada6153c722 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 22 Jul 2011 10:11:52 +0200 Subject: [PATCH 2/2] s3:loadparm: fix the reload of the configuration: also reload activated registry shares Autobuild-User: Michael Adam Autobuild-Date: Fri Jul 22 16:53:49 CEST 2011 on sn-devel-104 (cherry picked from commit efbe1602bd014eada4811f336bdccbf4692d3807) --- source3/param/loadparm.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index ed01c9b..bec525e 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -9628,8 +9628,12 @@ static bool lp_load_ex(const char *pszFname, bRetval = false; } - if (bRetval && lp_registry_shares() && allow_registry_shares) { - bRetval = process_registry_shares(); + if (bRetval && lp_registry_shares()) { + if (allow_registry_shares) { + bRetval = process_registry_shares(); + } else { + bRetval = reload_registry_shares(); + } } lp_add_auto_services(lp_auto_services()); -- 1.7.1