summaryrefslogtreecommitdiff
path: root/source4/param
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-13 01:27:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:58:41 -0500
commit871604e3101edfd4c17eec5b05077eeb5674b26b (patch)
treecffd9bcccf2dd2047d44af848d57d1f7452a4f5c /source4/param
parent2d5ca36872d10138ac997a0d91916abb9b637c6e (diff)
downloadsamba-871604e3101edfd4c17eec5b05077eeb5674b26b.tar.gz
samba-871604e3101edfd4c17eec5b05077eeb5674b26b.tar.bz2
samba-871604e3101edfd4c17eec5b05077eeb5674b26b.zip
r2302: added a '--option' option, allowing any global or default option in
smb.conf to be set on the command line. For example, you can use: smbtorture --option 'unicode=false' or smbtorture --option 'netbios name=myname' (This used to be commit 360a6b530e2295976ddefc138d1333411a94484d)
Diffstat (limited to 'source4/param')
-rw-r--r--source4/param/loadparm.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index 0d7bbb6d18..7ae4a29483 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -2639,6 +2639,33 @@ BOOL lp_set_cmdline(const char *pszParmName, const char *pszParmValue)
return True;
}
+/*
+ set a option from the commandline in 'a=b' format. Use to support --option
+*/
+BOOL lp_set_option(const char *option)
+{
+ char *p, *s;
+ BOOL ret;
+
+ s = strdup(option);
+ if (!s) {
+ return False;
+ }
+
+ p = strchr(s, '=');
+ if (!p) {
+ free(s);
+ return False;
+ }
+
+ *p = 0;
+
+ ret = lp_set_cmdline(s, p+1);
+ free(s);
+ return ret;
+}
+
+
/***************************************************************************
Print a parameter of the specified type.
***************************************************************************/