summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/share.c3
-rw-r--r--source4/param/share.h3
-rw-r--r--source4/param/share_classic.c3
-rw-r--r--source4/param/share_ldb.c9
-rw-r--r--source4/param/tests/share.c4
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)