From 6c999cd12344f2bb8b1d2941210b4c205b3e0aad Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 2 Dec 2007 22:32:11 +0100 Subject: r26236: Remove more uses of global_loadparm or specify loadparm_context explicitly. (This used to be commit 5b29ef7c03d9ae76b0ca909e9f03a58e1bad3521) --- source4/lib/registry/tools/common.c | 4 ++-- source4/lib/registry/tools/regdiff.c | 8 +++++--- source4/lib/registry/tools/regpatch.c | 3 ++- source4/lib/registry/tools/regshell.c | 3 ++- source4/lib/registry/tools/regtree.c | 3 ++- 5 files changed, 13 insertions(+), 8 deletions(-) (limited to 'source4/lib/registry/tools') diff --git a/source4/lib/registry/tools/common.c b/source4/lib/registry/tools/common.c index 0233f27437..6d766fd25c 100644 --- a/source4/lib/registry/tools/common.c +++ b/source4/lib/registry/tools/common.c @@ -65,12 +65,12 @@ struct registry_key *reg_common_open_file(const char *path, return reg_import_hive_key(h, hive_root, -1, NULL); } -struct registry_context *reg_common_open_local(struct cli_credentials *creds) +struct registry_context *reg_common_open_local(struct cli_credentials *creds, struct loadparm_context *lp_ctx) { WERROR error; struct registry_context *h; - error = reg_open_samba(NULL, &h, NULL, creds); + error = reg_open_samba(NULL, &h, lp_ctx, NULL, creds); if(!W_ERROR_IS_OK(error)) { fprintf(stderr, "Unable to open local registry:%s \n", diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index f96761cda0..1996861a2a 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -24,10 +24,12 @@ #include "lib/events/events.h" #include "lib/cmdline/popt_common.h" #include "lib/registry/tools/common.h" +#include "param/param.h" enum reg_backend { REG_UNKNOWN, REG_LOCAL, REG_REMOTE, REG_NULL }; static struct registry_context *open_backend(poptContext pc, + struct loadparm_context *lp_ctx, enum reg_backend backend, const char *remote_host) { @@ -39,7 +41,7 @@ static struct registry_context *open_backend(poptContext pc, poptPrintUsage(pc, stderr, 0); return NULL; case REG_LOCAL: - error = reg_open_samba(NULL, &ctx, NULL, cmdline_credentials); + error = reg_open_samba(NULL, &ctx, lp_ctx, NULL, cmdline_credentials); break; case REG_REMOTE: error = reg_open_remote(&ctx, NULL, cmdline_credentials, @@ -114,11 +116,11 @@ int main(int argc, const char **argv) } - h1 = open_backend(pc, backend1, remote1); + h1 = open_backend(pc, global_loadparm, backend1, remote1); if (h1 == NULL) return 1; - h2 = open_backend(pc, backend2, remote2); + h2 = open_backend(pc, global_loadparm, backend2, remote2); if (h2 == NULL) return 1; diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index 35f12c7e62..2f2cf789a9 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -24,6 +24,7 @@ #include "lib/cmdline/popt_common.h" #include "lib/registry/tools/common.h" #include "lib/registry/patchfile.h" +#include "param/param.h" int main(int argc, char **argv) { @@ -50,7 +51,7 @@ int main(int argc, char **argv) if (remote) { h = reg_common_open_remote (remote, cmdline_credentials); } else { - h = reg_common_open_local (cmdline_credentials); + h = reg_common_open_local (cmdline_credentials, global_loadparm); } if (h == NULL) diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index 7dbcf2f875..9b582c3c02 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -26,6 +26,7 @@ #include "lib/smbreadline/smbreadline.h" #include "librpc/gen_ndr/ndr_security.h" #include "lib/registry/tools/common.h" +#include "param/param.h" struct regshell_context { struct registry_context *registry; @@ -505,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); + ctx->registry = reg_common_open_local(cmdline_credentials, global_loadparm); } if (ctx->registry == NULL) diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 9f8d8c012d..f95fc1968d 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -23,6 +23,7 @@ #include "lib/registry/tools/common.h" #include "lib/events/events.h" #include "lib/cmdline/popt_common.h" +#include "param/param.h" /** * Print a registry key recursively @@ -132,7 +133,7 @@ int main(int argc, char **argv) } else if (file != NULL) { start_key = reg_common_open_file(file, cmdline_credentials); } else { - h = reg_common_open_local(cmdline_credentials); + h = reg_common_open_local(cmdline_credentials, global_loadparm); } if (h == NULL && start_key == NULL) -- cgit