diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-03 15:53:17 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:47:28 +0100 |
commit | ab69eb8d8901d23794c6a298718e67656ef4820e (patch) | |
tree | cd415ecd2aee4caa9e47f6c442d0d23b2f443b9c /source4/param | |
parent | 0a2f1a46a02d2c9497d05d7e534829dc6e9430dc (diff) | |
download | samba-ab69eb8d8901d23794c6a298718e67656ef4820e.tar.gz samba-ab69eb8d8901d23794c6a298718e67656ef4820e.tar.bz2 samba-ab69eb8d8901d23794c6a298718e67656ef4820e.zip |
r26250: Avoid global_loadparm in a couple more places.
(This used to be commit 2c6b755309fdf685cd0b0564272bf83038574a43)
Diffstat (limited to 'source4/param')
-rw-r--r-- | source4/param/secrets.c | 8 | ||||
-rw-r--r-- | source4/param/secrets.h | 6 | ||||
-rw-r--r-- | source4/param/share.c | 2 | ||||
-rw-r--r-- | source4/param/share_classic.c | 8 |
4 files changed, 12 insertions, 12 deletions
diff --git a/source4/param/secrets.c b/source4/param/secrets.c index eeced9ddbe..5a6df3174a 100644 --- a/source4/param/secrets.c +++ b/source4/param/secrets.c @@ -61,7 +61,7 @@ void secrets_shutdown(void) /** * open up the secrets database */ -bool secrets_init(void) +bool secrets_init(struct loadparm_context *lp_ctx) { char *fname; uint8_t dummy; @@ -69,8 +69,7 @@ bool secrets_init(void) if (tdb != NULL) return true; - fname = private_path(NULL, global_loadparm, - "secrets.tdb"); + fname = private_path(NULL, lp_ctx, "secrets.tdb"); tdb = tdb_wrap_open(talloc_autofree_context(), fname, 0, TDB_DEFAULT, O_RDWR|O_CREAT, 0600); @@ -141,6 +140,7 @@ struct ldb_context *secrets_db_connect(TALLOC_CTX *mem_ctx, struct loadparm_cont * @return pointer to a SID object if the SID could be obtained, NULL otherwise */ struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, const char *domain) { struct ldb_context *ldb; @@ -149,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, global_loadparm); + ldb = secrets_db_connect(mem_ctx, lp_ctx); 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 9d98db0d08..4a9eb25e7e 100644 --- a/source4/param/secrets.h +++ b/source4/param/secrets.h @@ -42,11 +42,11 @@ struct machine_acct_pass { * * @note Not called by systems with a working /dev/urandom. */ -void secrets_shutdown(void); -bool secrets_init(void); struct loadparm_context; +void secrets_shutdown(void); +bool secrets_init(struct loadparm_context *lp_ctx); 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); +struct dom_sid *secrets_get_domain_sid(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx, const char *domain); #endif /* _SECRETS_H */ diff --git a/source4/param/share.c b/source4/param/share.c index 6c0269d5fc..5bf5879290 100644 --- a/source4/param/share.c +++ b/source4/param/share.c @@ -134,7 +134,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, ops = share_backend_by_name(backend_name); if (!ops) { - DEBUG(0, ("share_init_connection: share backend [%s] not found!\n", lp_share_backend(global_loadparm))); + DEBUG(0, ("share_init_connection: share backend [%s] not found!\n", backend_name)); return NT_STATUS_INTERNAL_ERROR; } diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c index cf140f0d32..2dc40e3e25 100644 --- a/source4/param/share_classic.c +++ b/source4/param/share_classic.c @@ -32,7 +32,7 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, } (*ctx)->ops = ops; - (*ctx)->priv_data = NULL; + (*ctx)->priv_data = global_loadparm; return NT_STATUS_OK; } @@ -268,7 +268,7 @@ static NTSTATUS sclassic_list_all(TALLOC_CTX *mem_ctx, int num_services; const char **n; - num_services = lp_numservices(global_loadparm); + num_services = lp_numservices((struct loadparm_context *)ctx->priv_data); n = talloc_array(mem_ctx, const char *, num_services); if (!n) { @@ -277,7 +277,7 @@ static NTSTATUS sclassic_list_all(TALLOC_CTX *mem_ctx, } for (i = 0; i < num_services; i++) { - n[i] = talloc_strdup(n, lp_servicename(lp_servicebynum(global_loadparm, i))); + n[i] = talloc_strdup(n, lp_servicename(lp_servicebynum((struct loadparm_context *)ctx->priv_data, i))); if (!n[i]) { DEBUG(0,("ERROR: Out of memory!\n")); talloc_free(n); @@ -299,7 +299,7 @@ static NTSTATUS sclassic_get_config(TALLOC_CTX *mem_ctx, struct share_config *s; struct loadparm_service *service; - service = lp_service(global_loadparm, name); + service = lp_service((struct loadparm_context *)ctx->priv_data, name); if (service == NULL) { return NT_STATUS_OBJECT_NAME_NOT_FOUND; |