diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-13 22:46:55 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:50:08 +0100 |
commit | e31abef15f7696cf39e9e81307f153da93568e02 (patch) | |
tree | 1cc4d50c7b25b8471399d4f0b971145e13519f2f /source4/param | |
parent | 27b21a386ebeed66dd804a8b2e2256b739e32543 (diff) | |
download | samba-e31abef15f7696cf39e9e81307f153da93568e02.tar.gz samba-e31abef15f7696cf39e9e81307f153da93568e02.tar.bz2 samba-e31abef15f7696cf39e9e81307f153da93568e02.zip |
r26440: Remove more uses of global_loadparm.
(This used to be commit 8858cf39722f192865e531164c72039fd18d7a8d)
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/share.c | 3 | ||||
-rw-r--r-- | source4/param/share.h | 3 | ||||
-rw-r--r-- | source4/param/share_classic.c | 3 | ||||
-rw-r--r-- | source4/param/share_ldb.c | 9 | ||||
-rw-r--r-- | source4/param/tests/share.c | 4 |
5 files changed, 13 insertions, 9 deletions
diff --git a/source4/param/share.c b/source4/param/share.c index 4b747f85ae..2ada9999ea 100644 --- a/source4/param/share.c +++ b/source4/param/share.c @@ -127,6 +127,7 @@ NTSTATUS share_register(const struct share_ops *ops) } NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name, + struct loadparm_context *lp_ctx, struct share_context **ctx) { const struct share_ops *ops; @@ -137,7 +138,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name return NT_STATUS_INTERNAL_ERROR; } - return ops->init(mem_ctx, ops, ctx); + return ops->init(mem_ctx, ops, lp_ctx, ctx); } /* diff --git a/source4/param/share.h b/source4/param/share.h index fae1c31c13..51f45781c1 100644 --- a/source4/param/share.h +++ b/source4/param/share.h @@ -49,7 +49,8 @@ struct share_info { struct share_ops { const char *name; - NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct share_context **); + NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct loadparm_context *lp_ctx, + struct share_context **); const char *(*string_option)(struct share_config *, const char *, const char *); int (*int_option)(struct share_config *, const char *, int); bool (*bool_option)(struct share_config *, const char *, bool); diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c index 4a7fbcb263..b517c9c4c2 100644 --- a/source4/param/share_classic.c +++ b/source4/param/share_classic.c @@ -25,6 +25,7 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, + struct loadparm_context *lp_ctx, struct share_context **ctx) { *ctx = talloc(mem_ctx, struct share_context); @@ -34,7 +35,7 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, } (*ctx)->ops = ops; - (*ctx)->priv_data = global_loadparm; + (*ctx)->priv_data = lp_ctx; return NT_STATUS_OK; } diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c index 487359eff6..bdea94a5cd 100644 --- a/source4/param/share_ldb.c +++ b/source4/param/share_ldb.c @@ -27,7 +27,8 @@ #include "param/share.h" #include "param/param.h" -static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct share_context **ctx) +static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct loadparm_context *lp_ctx, + struct share_context **ctx) { struct ldb_context *sdb; @@ -37,9 +38,9 @@ static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, stru return NT_STATUS_NO_MEMORY; } - sdb = ldb_wrap_connect(*ctx, global_loadparm, - private_path(*ctx, global_loadparm, "share.ldb"), - system_session(*ctx, global_loadparm), + sdb = ldb_wrap_connect(*ctx, lp_ctx, + private_path(*ctx, lp_ctx, "share.ldb"), + system_session(*ctx, lp_ctx), NULL, 0, NULL); if (!sdb) { diff --git a/source4/param/tests/share.c b/source4/param/tests/share.c index 1f8ecb2d84..390da9dede 100644 --- a/source4/param/tests/share.c +++ b/source4/param/tests/share.c @@ -178,12 +178,12 @@ static void tcase_add_share_tests(struct torture_tcase *tcase) static bool setup_ldb(struct torture_context *tctx, void **data) { - return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "ldb", (struct share_context **)data)); + return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "ldb", tctx->lp_ctx, (struct share_context **)data)); } static bool setup_classic(struct torture_context *tctx, void **data) { - return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "classic", (struct share_context **)data)); + return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "classic", tctx->lp_ctx, (struct share_context **)data)); } static bool teardown(struct torture_context *tctx, void *data) |