diff options
Diffstat (limited to 'source4/utils')
-rw-r--r-- | source4/utils/net/net.c | 2 | ||||
-rw-r--r-- | source4/utils/nmblookup.c | 8 | ||||
-rw-r--r-- | source4/utils/ntlm_auth.c | 24 | ||||
-rw-r--r-- | source4/utils/testparm.c | 2 |
4 files changed, 19 insertions, 17 deletions
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;i<num_interfaces;i++) { - const char *bcast = iface_n_bcast(global_loadparm, i); + const char *bcast = iface_n_bcast(lp_ctx, i); if (bcast == NULL) continue; status = do_node_query(nbtsock, bcast, nbt_port, node_name, node_type, true); @@ -353,7 +353,7 @@ int main(int argc, const char *argv[]) while (poptPeekArg(pc)) { const char *name = poptGetArg(pc); - ret &= process_one(name, lp_nbt_port(global_loadparm)); + ret &= process_one(cmdline_lp_ctx, name, lp_nbt_port(cmdline_lp_ctx)); } poptFreeContext(pc); diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index cb2fbd63c1..93d1909a56 100644 --- a/source4/utils/ntlm_auth.c +++ b/source4/utils/ntlm_auth.c @@ -77,7 +77,8 @@ static void manage_ntlm_server_1_request (enum stdio_helper_mode stdio_helper_mo char *buf, int length, void **private, unsigned int mux_id, void **private2); -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); static const struct { @@ -329,7 +330,7 @@ static const char *get_password(struct cli_credentials *credentials) mux_printf((unsigned int)credentials->priv_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<NUM_HELPER_MODES; i++) { if (strcmp(helper_protocol, stdio_helper_protocols[i].name) == 0) { - squid_stream(stdio_helper_protocols[i].mode, stdio_helper_protocols[i].fn); + squid_stream(cmdline_lp_ctx, stdio_helper_protocols[i].mode, stdio_helper_protocols[i].fn); exit(0); } } @@ -1123,7 +1125,7 @@ int main(int argc, const char **argv) } if (opt_workstation == NULL) { - opt_workstation = lp_netbios_name(global_loadparm); + opt_workstation = lp_netbios_name(cmdline_lp_ctx); } if (!opt_password) { @@ -1133,7 +1135,7 @@ int main(int argc, const char **argv) { char *user; - asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(global_loadparm), opt_username); + asprintf(&user, "%s%c%s", opt_domain, *lp_winbind_separator(cmdline_lp_ctx), opt_username); if (!check_plaintext_auth(user, opt_password, true)) { return 1; } diff --git a/source4/utils/testparm.c b/source4/utils/testparm.c index fe8cc7124a..a4ff522186 100644 --- a/source4/utils/testparm.c +++ b/source4/utils/testparm.c @@ -234,7 +234,7 @@ static int do_share_checks(struct loadparm_context *lp_ctx, const char *cname, c } */ - lp_ctx = global_loadparm; + lp_ctx = cmdline_lp_ctx; /* We need this to force the output */ lp_set_cmdline(lp_ctx, "log level", "2"); |