diff options
author | Andrew Bartlett <abartlet@samba.org> | 2010-11-27 08:17:09 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2010-11-27 01:02:40 +0100 |
commit | 1e96da556acc021ed296551f137d5600e2c1a58c (patch) | |
tree | 102303613e32511e70863bd4886309f080f0297c /source3/param | |
parent | 58db821de1cc8c3eca9257638e7ed1b250b28400 (diff) | |
download | samba-1e96da556acc021ed296551f137d5600e2c1a58c.tar.gz samba-1e96da556acc021ed296551f137d5600e2c1a58c.tar.bz2 samba-1e96da556acc021ed296551f137d5600e2c1a58c.zip |
s3-param Fix lp_set_cmdline() to set the flag on alias values too
Otherwise, -d10 would be overridden by 'debug level = 1', because
debug level is an alias of 'log level' which -d was setting.
Andrew Bartlett
Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Sat Nov 27 01:02:40 CET 2010 on sn-devel-104
Diffstat (limited to 'source3/param')
-rw-r--r-- | source3/param/loadparm.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 31402cc0a2..0bc27dca03 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -7891,7 +7891,7 @@ FLAG_CMDLINE won't be overridden by loads from smb.conf. static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmValue, bool store_values) { - int parmnum; + int parmnum, i; parmnum = map_parameter(pszParmName); if (parmnum >= 0) { parm_table[parmnum].flags &= ~FLAG_CMDLINE; @@ -7900,6 +7900,16 @@ static bool lp_set_cmdline_helper(const char *pszParmName, const char *pszParmVa } parm_table[parmnum].flags |= FLAG_CMDLINE; + /* we have to also set FLAG_CMDLINE on aliases. Aliases must + * be grouped in the table, so we don't have to search the + * whole table */ + for (i=parmnum-1;i>=0 && parm_table[i].ptr == parm_table[parmnum].ptr;i--) { + parm_table[i].flags |= FLAG_CMDLINE; + } + for (i=parmnum+1;i<NUMPARAMETERS && parm_table[i].ptr == parm_table[parmnum].ptr;i++) { + parm_table[i].flags |= FLAG_CMDLINE; + } + if (store_values) { store_lp_set_cmdline(pszParmName, pszParmValue); } |