From b65dba2245bf382c47d65c95ac9b1efa43918fc0 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 10 Dec 2007 04:33:16 +0100 Subject: r26355: Eliminate global_loadparm in more places. (This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d) --- source4/lib/cmdline/popt_common.h | 1 + source4/lib/ldb/ldb_ildap/ldb_ildap.c | 5 +++-- source4/lib/ldb/tools/cmdline.c | 6 +++--- source4/lib/registry/tools/regdiff.c | 4 ++-- source4/lib/registry/tools/regpatch.c | 4 ++-- source4/lib/registry/tools/regshell.c | 4 ++-- source4/lib/registry/tools/regtree.c | 4 ++-- 7 files changed, 15 insertions(+), 13 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/cmdline/popt_common.h b/source4/lib/cmdline/popt_common.h index 7de8027c0b..df432bb475 100644 --- a/source4/lib/cmdline/popt_common.h +++ b/source4/lib/cmdline/popt_common.h @@ -34,5 +34,6 @@ extern struct poptOption popt_common_credentials[]; #define POPT_COMMON_CREDENTIALS { NULL, 0, POPT_ARG_INCLUDE_TABLE, popt_common_credentials, 0, "Authentication options:", NULL }, extern struct cli_credentials *cmdline_credentials; +extern struct loadparm_context *cmdline_lp_ctx; #endif /* _POPT_COMMON_H */ diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index 0c0ee629bf..a834e912d4 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -756,7 +756,8 @@ static int ildb_connect(struct ldb_context *ldb, const char *url, } module->private_data = ildb; ildb->module = module; - ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "EventContext")); + ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "loadparm"), + ldb_get_opaque(ldb, "EventContext")); if (!ildb->ldap) { ldb_oom(ldb); goto failed; @@ -793,7 +794,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url, goto failed; } } else { - status = ldap_bind_sasl(ildb->ldap, creds, global_loadparm); + status = ldap_bind_sasl(ildb->ldap, creds, ldb_get_opaque(ldb, "loadparm")); if (!NT_STATUS_IS_OK(status)) { ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n", ldap_errstr(ildb->ldap, module, status)); diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index aff730c178..8ee1994615 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -210,15 +210,15 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, #if (_SAMBA_BUILD_ >= 4) /* Must be after we have processed command line options */ - gensec_init(global_loadparm); + gensec_init(cmdline_lp_ctx); - if (ldb_set_opaque(ldb, "sessionInfo", system_session(ldb, global_loadparm))) { + if (ldb_set_opaque(ldb, "sessionInfo", system_session(ldb, cmdline_lp_ctx))) { goto failed; } if (ldb_set_opaque(ldb, "credentials", cmdline_credentials)) { goto failed; } - if (ldb_set_opaque(ldb, "loadparm", global_loadparm)) { + if (ldb_set_opaque(ldb, "loadparm", cmdline_lp_ctx)) { goto failed; } diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index ea4b754fe7..406eaeea3d 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -116,11 +116,11 @@ int main(int argc, const char **argv) } - h1 = open_backend(pc, global_loadparm, backend1, remote1); + h1 = open_backend(pc, cmdline_lp_ctx, backend1, remote1); if (h1 == NULL) return 1; - h2 = open_backend(pc, global_loadparm, backend2, remote2); + h2 = open_backend(pc, cmdline_lp_ctx, backend2, remote2); if (h2 == NULL) return 1; diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 441138832e..ddbedce18a 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -49,9 +49,9 @@ int main(int argc, char **argv) } if (remote) { - h = reg_common_open_remote (remote, global_loadparm, cmdline_credentials); + h = reg_common_open_remote (remote, cmdline_lp_ctx, cmdline_credentials); } else { - h = reg_common_open_local (cmdline_credentials, global_loadparm); + h = reg_common_open_local (cmdline_credentials, cmdline_lp_ctx); } if (h == NULL) diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 7169d7c9f8..2c692952fb 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -497,7 +497,7 @@ int main(int argc, char **argv) ctx = talloc_zero(NULL, struct regshell_context); if (remote != NULL) { - ctx->registry = reg_common_open_remote(remote, global_loadparm, + ctx->registry = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { ctx->current = reg_common_open_file(file, cmdline_credentials); @@ -506,7 +506,7 @@ int main(int argc, char **argv) ctx->registry = ctx->current->context; ctx->path = talloc_strdup(ctx, ""); } else { - ctx->registry = reg_common_open_local(cmdline_credentials, global_loadparm); + ctx->registry = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx); } if (ctx->registry == NULL) diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 6c21f2cbad..b267e11b43 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -129,11 +129,11 @@ int main(int argc, char **argv) } if (remote != NULL) { - h = reg_common_open_remote(remote, global_loadparm, cmdline_credentials); + h = reg_common_open_remote(remote, cmdline_lp_ctx, cmdline_credentials); } else if (file != NULL) { start_key = reg_common_open_file(file, cmdline_credentials); } else { - h = reg_common_open_local(cmdline_credentials, global_loadparm); + h = reg_common_open_local(cmdline_credentials, cmdline_lp_ctx); } if (h == NULL && start_key == NULL) -- cgit