diff options
author | Michael Adam <obnox@samba.org> | 2009-04-29 01:31:03 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2009-04-29 02:20:19 +0200 |
commit | fb3b6576127ce837ac711e87c293d1f4cf97473c (patch) | |
tree | 85f3908aa241f76313185b942ec63577447a81bc /source3/param | |
parent | 67ca76c288eb095ae59e98927317d51c96c89551 (diff) | |
download | samba-fb3b6576127ce837ac711e87c293d1f4cf97473c.tar.gz samba-fb3b6576127ce837ac711e87c293d1f4cf97473c.tar.bz2 samba-fb3b6576127ce837ac711e87c293d1f4cf97473c.zip |
s3:loadparm: refactor process_registry_service out or process_registry_globals
Michael
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 36 |
1 files changed, 25 insertions, 11 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 7e2affed08..380b9e1b8c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6824,10 +6824,10 @@ static bool process_smbconf_service(struct smbconf_service *service) return true; } -/* - * process_registry_globals +/** + * load a service from registry and activate it */ -static bool process_registry_globals(void) +bool process_registry_service(const char *service_name) { WERROR werr; struct smbconf_service *service = NULL; @@ -6839,19 +6839,18 @@ static bool process_registry_globals(void) goto done; } - ret = do_parameter("registry shares", "yes", NULL); - if (!ret) { - goto done; - } + DEBUG(5, ("process_registry_service: service name %s\n", service_name)); - if (!smbconf_share_exists(conf_ctx, GLOBAL_NAME)) { - /* nothing to read from the registry yet but make sure lp_load - * doesn't return false */ + if (!smbconf_share_exists(conf_ctx, service_name)) { + /* + * Registry does not contain data for this service (yet), + * but make sure lp_load doesn't return false. + */ ret = true; goto done; } - werr = smbconf_get_share(conf_ctx, mem_ctx, GLOBAL_NAME, &service); + werr = smbconf_get_share(conf_ctx, mem_ctx, service_name, &service); if (!W_ERROR_IS_OK(werr)) { goto done; } @@ -6869,6 +6868,21 @@ done: return ret; } +/* + * process_registry_globals + */ +static bool process_registry_globals(void) +{ + bool ret; + + ret = do_parameter("registry shares", "yes", NULL); + if (!ret) { + return ret; + } + + return process_registry_service(GLOBAL_NAME); +} + static bool process_registry_shares(void) { WERROR werr; |