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/utils/net/net.c | 2 +- source4/utils/nmblookup.c | 8 ++++---- source4/utils/ntlm_auth.c | 24 +++++++++++++----------- source4/utils/testparm.c | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) (limited to 'source4/utils') diff --git a/source4/utils/net/net.c b/source4/utils/net/net.c index 2741f485cc..2c95e9033d 100644 --- a/source4/utils/net/net.c +++ b/source4/utils/net/net.c @@ -193,7 +193,7 @@ static int binary_net(int argc, const char **argv) ZERO_STRUCTP(ctx); ctx->mem_ctx = mem_ctx; - ctx->lp_ctx = global_loadparm; + ctx->lp_ctx = cmdline_lp_ctx; ctx->credentials = cmdline_credentials; rc = net_run_function(ctx, argc_new-1, argv_new+1, net_functable, net_usage); diff --git a/source4/utils/nmblookup.c b/source4/utils/nmblookup.c index 9f121390f6..a3e33e2748 100644 --- a/source4/utils/nmblookup.c +++ b/source4/utils/nmblookup.c @@ -179,7 +179,7 @@ static NTSTATUS do_node_query(struct nbt_name_socket *nbtsock, } -static bool process_one(const char *name, int nbt_port) +static bool process_one(struct loadparm_context *lp_ctx, const char *name, int nbt_port) { TALLOC_CTX *tmp_ctx = talloc_new(NULL); enum nbt_name_type node_type = NBT_NAME_CLIENT; @@ -241,9 +241,9 @@ static bool process_one(const char *name, int nbt_port) status = do_node_query(nbtsock, options.unicast_address, nbt_port, node_name, node_type, false); } else { - int i, num_interfaces = iface_count(global_loadparm); + int i, num_interfaces = iface_count(lp_ctx); for (i=0;ipriv_data, "PW\n"); credentials->priv_data = NULL; - manage_squid_request(NUM_HELPER_MODES /* bogus */, manage_gensec_get_pw_request, (void **)&password); + manage_squid_request(cmdline_lp_ctx, NUM_HELPER_MODES /* bogus */, manage_gensec_get_pw_request, (void **)&password); return password; } @@ -897,7 +898,7 @@ static void manage_ntlm_server_1_request(enum stdio_helper_mode stdio_helper_mod } } -static void manage_squid_request(enum stdio_helper_mode helper_mode, +static void manage_squid_request(struct loadparm_context *lp_ctx, enum stdio_helper_mode helper_mode, stdio_helper_function fn, void **private2) { char *buf; @@ -1000,17 +1001,18 @@ static void manage_squid_request(enum stdio_helper_mode helper_mode, private = &normal_private; } - fn(helper_mode, global_loadparm, c, length, private, mux_id, private2); + fn(helper_mode, lp_ctx, c, length, private, mux_id, private2); talloc_free(buf); } -static void squid_stream(enum stdio_helper_mode stdio_mode, +static void squid_stream(struct loadparm_context *lp_ctx, + enum stdio_helper_mode stdio_mode, stdio_helper_function fn) { /* initialize FDescs */ x_setbuf(x_stdout, NULL); x_setbuf(x_stderr, NULL); while(1) { - manage_squid_request(stdio_mode, fn, NULL); + manage_squid_request(lp_ctx, stdio_mode, fn, NULL); } } @@ -1093,17 +1095,17 @@ int main(int argc, const char **argv) return 1; } - gensec_init(global_loadparm); + gensec_init(cmdline_lp_ctx); if (opt_domain == NULL) { - opt_domain = lp_workgroup(global_loadparm); + opt_domain = lp_workgroup(cmdline_lp_ctx); } if (helper_protocol) { int i; for (i=0; i