summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-08 06:58:19 +0200
committerAndrew Bartlett <abartlet@samba.org>2011-05-08 17:36:25 +0200
commitac82ac4b83d3910734943bbc4caba5ef1efefe06 (patch)
treebbe2ea16dd7ecdc738c2214e9fd7dcfaee28a7b4 /source4
parentd1df1cb714289b90dc173a72e488773960952402 (diff)
downloadsamba-ac82ac4b83d3910734943bbc4caba5ef1efefe06.tar.gz
samba-ac82ac4b83d3910734943bbc4caba5ef1efefe06.tar.bz2
samba-ac82ac4b83d3910734943bbc4caba5ef1efefe06.zip
s4-param cope with doulbe-parsing of -foo and +foo lists
For some reason these lists are parsed twice, and so any -foo was failing as it was already removed the first time. Andrew Bartlett
Diffstat (limited to 'source4')
-rw-r--r--source4/param/loadparm.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index ca87870c72..b101054318 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -1711,17 +1711,23 @@ static bool set_variable(TALLOC_CTX *mem_ctx, int parmnum, void *parm_ptr,
char **new_list = str_list_make(mem_ctx,
pszParmValue, NULL);
for (i=0; new_list[i]; i++) {
- if (new_list[i][0] == '+' && new_list[i][1]) {
+ if (new_list[i][0] == '+' && new_list[i][1] &&
+ (!str_list_check(*(const char ***)parm_ptr,
+ &new_list[i][1]))) {
*(const char ***)parm_ptr = str_list_add(*(const char ***)parm_ptr,
&new_list[i][1]);
} else if (new_list[i][0] == '-' && new_list[i][1]) {
+#if 0 /* This is commented out because we sometimes parse the list
+ * twice, and so we can't assert on this */
if (!str_list_check(*(const char ***)parm_ptr,
&new_list[i][1])) {
- DEBUG(0, ("Unsupported value for: %s = %s, %s is not in the original list\n",
- pszParmName, pszParmValue, new_list[i]));
+ DEBUG(0, ("Unsupported value for: %s = %s, %s is not in the original list [%s]\n",
+ pszParmName, pszParmValue, new_list[i],
+ str_list_join_shell(mem_ctx, *(const char ***)parm_ptr, ' ')));
return false;
}
+#endif
str_list_remove(*(const char ***)parm_ptr,
&new_list[i][1]);
} else {