summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-08-23 15:32:05 +0200
committerBjoern Jacke <bj@sernet.de>2012-08-24 11:28:17 +0200
commitf83521a4ca26c8b14af1c407c49426d8dd8179f7 (patch)
tree15e95a9c042912d9b4f32563d3c79b42b27168ec /lib
parentcbecd1595c9ed4f0eb8eb76b60ae28eea6a395f4 (diff)
downloadsamba-f83521a4ca26c8b14af1c407c49426d8dd8179f7.tar.gz
samba-f83521a4ca26c8b14af1c407c49426d8dd8179f7.tar.bz2
samba-f83521a4ca26c8b14af1c407c49426d8dd8179f7.zip
lib/param: fix usage of 'write list = +Group'
metze Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Fri Aug 24 11:28:17 CEST 2012 on sn-devel-104
Diffstat (limited to 'lib')
-rw-r--r--lib/param/loadparm.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c
index 4751a06198..38140877e7 100644
--- a/lib/param/loadparm.c
+++ b/lib/param/loadparm.c
@@ -1355,13 +1355,19 @@ 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 (*(const char ***)parm_ptr != NULL &&
+ new_list[i][0] == '+' &&
+ new_list[i][1])
+ {
if (!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]) {
+ } else if (*(const char ***)parm_ptr != NULL &&
+ new_list[i][0] == '-' &&
+ new_list[i][1])
+ {
str_list_remove(*(const char ***)parm_ptr,
&new_list[i][1]);
} else {