summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/param/loadparm.c12
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);
}