diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-11-29 16:01:16 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:46:51 +0100 |
commit | 991ee1aff092187bcfdd0ee1d9eb15361f73d5f7 (patch) | |
tree | 791d32dde17b8d4612b8526d5d81ef81a681928b /source4/param | |
parent | 0e191fa26ab6f0f4119eccca0170e5ebd7f46382 (diff) | |
download | samba-991ee1aff092187bcfdd0ee1d9eb15361f73d5f7.tar.gz samba-991ee1aff092187bcfdd0ee1d9eb15361f73d5f7.tar.bz2 samba-991ee1aff092187bcfdd0ee1d9eb15361f73d5f7.zip |
r26205: Pass loadparm_context to secrets_db_connect() rather than using global context.
(This used to be commit 5718b6cfee86ddfc9cf405c98c68ba848df4d9d7)
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/secrets.c | 11 | ||||
-rw-r--r-- | source4/param/secrets.h | 6 |
2 files changed, 10 insertions, 7 deletions
diff --git a/source4/param/secrets.c b/source4/param/secrets.c index 308c5a607b..eeced9ddbe 100644 --- a/source4/param/secrets.c +++ b/source4/param/secrets.c @@ -99,18 +99,18 @@ bool secrets_init(void) /** connect to the secrets ldb */ -struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx) +struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx) { char *path; const char *url; struct ldb_context *ldb; - url = lp_secrets_url(global_loadparm); + url = lp_secrets_url(lp_ctx); if (!url || !url[0]) { return NULL; } - path = private_path(mem_ctx, global_loadparm, url); + path = private_path(mem_ctx, lp_ctx, url); if (!path) { return NULL; } @@ -123,6 +123,9 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx) return NULL; } + ldb_set_modules_dir(ldb, + talloc_asprintf(ldb, "%s/ldb", lp_modulesdir(lp_ctx))); + if (ldb_connect(ldb, path, 0, NULL) != 0) { talloc_free(path); return NULL; @@ -146,7 +149,7 @@ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, const char *attrs[] = { "objectSid", NULL }; struct dom_sid *result = NULL; - ldb = secrets_db_connect(mem_ctx); + ldb = secrets_db_connect(mem_ctx, global_loadparm); if (ldb == NULL) { DEBUG(5, ("secrets_db_connect failed\n")); return NULL; diff --git a/source4/param/secrets.h b/source4/param/secrets.h index 5aabb849c5..9d98db0d08 100644 --- a/source4/param/secrets.h +++ b/source4/param/secrets.h @@ -44,9 +44,9 @@ struct machine_acct_pass { */ void secrets_shutdown(void); bool secrets_init(void); -struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx); -struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, - const char *domain); +struct loadparm_context; +struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx); +struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, const char *domain); #endif /* _SECRETS_H */ |