diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-10 04:33:16 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:49:01 +0100 |
commit | b65dba2245bf382c47d65c95ac9b1efa43918fc0 (patch) | |
tree | e2a474ba5bd99368423ad11d3632c55a51ed865c /source4/utils/ntlm_auth.c | |
parent | 4a36b71675a5ea2a22d7cf2a79d61a3cd511e99f (diff) | |
download | samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.tar.gz |
r26355: Eliminate global_loadparm in more places.
(This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d)
Diffstat (limited to 'source4/utils/ntlm_auth.c')
-rw-r--r-- | source4/utils/ntlm_auth.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/source4/utils/ntlm_auth.c b/source4/utils/ntlm_auth.c index cb2fbd63c15..93d1909a56a 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; } |