diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-10 04:33:16 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:01 +0100 |
commit | b65dba2245bf382c47d65c95ac9b1efa43918fc0 (patch) | |
tree | e2a474ba5bd99368423ad11d3632c55a51ed865c /source4/param | |
parent | 4a36b71675a5ea2a22d7cf2a79d61a3cd511e99f (diff) | |
download | samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.tar.gz samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.tar.bz2 samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.zip |
r26355: Eliminate global_loadparm in more places.
(This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d)
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/share.c | 6 | ||||
-rw-r--r-- | source4/param/share_classic.c | 16 | ||||
-rw-r--r-- | source4/param/tests/share.c | 2 |
3 files changed, 14 insertions, 10 deletions
diff --git a/source4/param/share.c b/source4/param/share.c index 5bf5879290..7ee1d8037a 100644 --- a/source4/param/share.c +++ b/source4/param/share.c @@ -149,15 +149,11 @@ NTSTATUS share_get_context(TALLOC_CTX *mem_ctx, struct share_context **ctx) /* initialise the SHARE subsystem */ -NTSTATUS share_init(struct loadparm_context *lp_ctx) +NTSTATUS share_init(void) { init_module_fn static_init[] = STATIC_share_MODULES; - init_module_fn *shared_init = load_samba_modules(NULL, lp_ctx, "share"); run_init_functions(static_init); - run_init_functions(shared_init); - - talloc_free(shared_init); return NT_STATUS_OK; } diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c index ab1b4bf904..4a7fbcb263 100644 --- a/source4/param/share_classic.c +++ b/source4/param/share_classic.c @@ -45,6 +45,8 @@ static const char *sclassic_string_option(struct share_config *scfg, { struct loadparm_service *s = talloc_get_type(scfg->opaque, struct loadparm_service); + struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, + struct loadparm_context); char *parm, *val; const char *ret; @@ -57,7 +59,7 @@ static const char *sclassic_string_option(struct share_config *scfg, *val = '\0'; val++; - ret = lp_parm_string(global_loadparm, s, parm, val); + ret = lp_parm_string(lp_ctx, s, parm, val); if (!ret) { ret = defval; } @@ -105,6 +107,8 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name, { struct loadparm_service *s = talloc_get_type(scfg->opaque, struct loadparm_service); + struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, + struct loadparm_context); char *parm, *val; int ret; @@ -117,7 +121,7 @@ static int sclassic_int_option(struct share_config *scfg, const char *opt_name, *val = '\0'; val++; - ret = lp_parm_int(global_loadparm, s, parm, val, defval); + ret = lp_parm_int(lp_ctx, s, parm, val, defval); if (!ret) { ret = defval; } @@ -161,6 +165,8 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name { struct loadparm_service *s = talloc_get_type(scfg->opaque, struct loadparm_service); + struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, + struct loadparm_context); char *parm, *val; bool ret; @@ -173,7 +179,7 @@ static bool sclassic_bool_option(struct share_config *scfg, const char *opt_name *val = '\0'; val++; - ret = lp_parm_bool(global_loadparm, s, parm, val, defval); + ret = lp_parm_bool(lp_ctx, s, parm, val, defval); talloc_free(parm); return ret; } @@ -228,6 +234,8 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar { struct loadparm_service *s = talloc_get_type(scfg->opaque, struct loadparm_service); + struct loadparm_context *lp_ctx = talloc_get_type(scfg->ctx->priv_data, + struct loadparm_context); char *parm, *val; const char **ret; @@ -240,7 +248,7 @@ static const char **sclassic_string_list_option(TALLOC_CTX *mem_ctx, struct shar *val = '\0'; val++; - ret = lp_parm_string_list(mem_ctx, global_loadparm, s, parm, val, ",;"); + ret = lp_parm_string_list(mem_ctx, lp_ctx, s, parm, val, ",;"); talloc_free(parm); return ret; } diff --git a/source4/param/tests/share.c b/source4/param/tests/share.c index 26af71d06f..1f8ecb2d84 100644 --- a/source4/param/tests/share.c +++ b/source4/param/tests/share.c @@ -197,7 +197,7 @@ struct torture_suite *torture_local_share(TALLOC_CTX *mem_ctx) struct torture_suite *suite = torture_suite_create(mem_ctx, "SHARE"); struct torture_tcase *tcase; - share_init(global_loadparm); + share_init(); tcase = torture_suite_add_tcase(suite, "ldb"); torture_tcase_set_fixture(tcase, setup_ldb, teardown); |