summaryrefslogtreecommitdiff
path: root/source4/utils
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-10 04:33:16 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:49:01 +0100
commitb65dba2245bf382c47d65c95ac9b1efa43918fc0 (patch)
treee2a474ba5bd99368423ad11d3632c55a51ed865c /source4/utils
parent4a36b71675a5ea2a22d7cf2a79d61a3cd511e99f (diff)
downloadsamba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.tar.gz
samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.tar.bz2
samba-b65dba2245bf382c47d65c95ac9b1efa43918fc0.zip
r26355: Eliminate global_loadparm in more places.
(This used to be commit 5d589a0d94bd76a9b4c9fc748854e8098ea43c4d)
Diffstat (limited to 'source4/utils')
-rw-r--r--source4/utils/net/net.c2
-rw-r--r--source4/utils/nmblookup.c8
-rw-r--r--source4/utils/ntlm_auth.c24
-rw-r--r--source4/utils/testparm.c2
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");