diff options
author | Michael Adam <obnox@samba.org> | 2009-04-29 01:31:03 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-04-29 13:00:54 +0200 |
commit | 6950d7b0302a70bc62ff1eeb3cf16e220523d1c7 (patch) | |
tree | d50f554b5c92ee50aef6fd11fd52abbf5c622cd3 | |
parent | 1d1786bdb58569ea710740f45aca61119ecfa8ae (diff) | |
download | samba-6950d7b0302a70bc62ff1eeb3cf16e220523d1c7.tar.gz |
s3:loadparm: refactor process_registry_service out or process_registry_globals
Michael
(cherry picked from commit fb3b6576127ce837ac711e87c293d1f4cf97473c)
(cherry picked from commit 480af4e0ead10241aa94f4095c7fa580240fec00)
-rw-r--r-- | source3/include/proto.h | 1 | ||||
-rw-r--r-- | source3/param/loadparm.c | 36 |
2 files changed, 26 insertions, 11 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index 5d665c653a2..36580e95505 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4256,6 +4256,7 @@ bool lp_string_is_valid_boolean(const char *parm_value); bool lp_invert_boolean(const char *str, const char **inverse_str); bool lp_canonicalize_boolean(const char *str, const char**canon_str); bool service_ok(int iService); +bool process_registry_service(const char *service_name); bool lp_config_backend_is_registry(void); bool lp_config_backend_is_file(void); bool lp_file_list_changed(void); diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 68a6ca20300..2dd233c24a0 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -6790,10 +6790,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; @@ -6805,19 +6805,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; } @@ -6835,6 +6834,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; |