summaryrefslogtreecommitdiff
path: root/source4/lib/cmdline
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-02 22:32:11 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:15 +0100
commit6c999cd12344f2bb8b1d2941210b4c205b3e0aad (patch)
tree0911e4ca75694e080173c2863e2c41ff5881309c /source4/lib/cmdline
parent934e932387ea5668ec000bcefe4ec86935297339 (diff)
downloadsamba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.gz
samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.tar.bz2
samba-6c999cd12344f2bb8b1d2941210b4c205b3e0aad.zip
r26236: Remove more uses of global_loadparm or specify loadparm_context explicitly.
(This used to be commit 5b29ef7c03d9ae76b0ca909e9f03a58e1bad3521)
Diffstat (limited to 'source4/lib/cmdline')
-rw-r--r--source4/lib/cmdline/popt_common.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source4/lib/cmdline/popt_common.c b/source4/lib/cmdline/popt_common.c
index 41eb70094e..1c96bf64cf 100644
--- a/source4/lib/cmdline/popt_common.c
+++ b/source4/lib/cmdline/popt_common.c
@@ -47,6 +47,7 @@ static void popt_common_callback(poptContext con,
const char *arg, const void *data)
{
const char *pname;
+ struct loadparm_context *lp_ctx = global_loadparm; /* FIXME: allow overriding */
if (reason == POPT_CALLBACK_REASON_POST) {
if (!lp_loaded()) {
@@ -81,7 +82,7 @@ static void popt_common_callback(poptContext con,
switch(opt->val) {
case 'd':
- lp_set_cmdline(global_loadparm, "log level", arg);
+ lp_set_cmdline(lp_ctx, "log level", arg);
break;
case OPT_DEBUG_STDERR:
@@ -94,7 +95,7 @@ static void popt_common_callback(poptContext con,
case 'O':
if (arg) {
- lp_set_cmdline(global_loadparm, "socket options", arg);
+ lp_set_cmdline(lp_ctx, "socket options", arg);
}
break;
@@ -107,37 +108,37 @@ static void popt_common_callback(poptContext con,
case 'l':
if (arg) {
char *new_logfile = talloc_asprintf(NULL, "%s/log.%s", arg, pname);
- lp_set_cmdline(global_loadparm, "log file", new_logfile);
+ lp_set_cmdline(lp_ctx, "log file", new_logfile);
talloc_free(new_logfile);
}
break;
case 'W':
- lp_set_cmdline(global_loadparm, "workgroup", arg);
+ lp_set_cmdline(lp_ctx, "workgroup", arg);
break;
case 'r':
- lp_set_cmdline(global_loadparm, "realm", arg);
+ lp_set_cmdline(lp_ctx, "realm", arg);
break;
case 'n':
- lp_set_cmdline(global_loadparm, "netbios name", arg);
+ lp_set_cmdline(lp_ctx, "netbios name", arg);
break;
case 'i':
- lp_set_cmdline(global_loadparm, "netbios scope", arg);
+ lp_set_cmdline(lp_ctx, "netbios scope", arg);
break;
case 'm':
- lp_set_cmdline(global_loadparm, "client max protocol", arg);
+ lp_set_cmdline(lp_ctx, "client max protocol", arg);
break;
case 'R':
- lp_set_cmdline(global_loadparm, "name resolve order", arg);
+ lp_set_cmdline(lp_ctx, "name resolve order", arg);
break;
case OPT_OPTION:
- if (!lp_set_option(global_loadparm, arg)) {
+ if (!lp_set_option(lp_ctx, arg)) {
fprintf(stderr, "Error setting option '%s'\n", arg);
exit(1);
}