diff options
author | Andrew Tridgell <tridge@samba.org> | 2011-12-06 11:30:24 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-12-15 23:36:22 +0100 |
commit | 77a551d613059fd2df0fbfbd86f206c2b59e91a7 (patch) | |
tree | 7998030e024b5417034f8067558e55f7e20bca6c /lib/param | |
parent | fae42c1f41435bf087c23d384cd6147dd9f7f4ef (diff) | |
download | samba-77a551d613059fd2df0fbfbd86f206c2b59e91a7.tar.gz samba-77a551d613059fd2df0fbfbd86f206c2b59e91a7.tar.bz2 samba-77a551d613059fd2df0fbfbd86f206c2b59e91a7.zip |
loadparm: fixed service list handling
when you have:
server services = +smb -s3fs
and 'smb' is already in the list, then this should not be an
error. This ensures that a config that specifically sets the services
it wants doesn't generate an error if the service list being set
happens to be the default
Diffstat (limited to 'lib/param')
-rw-r--r-- | lib/param/loadparm.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/lib/param/loadparm.c b/lib/param/loadparm.c index 48b5221c5a..37d4d0ff0b 100644 --- a/lib/param/loadparm.c +++ b/lib/param/loadparm.c @@ -2509,23 +2509,13 @@ 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] && - (!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 (new_list[i][0] == '+' && new_list[i][1]) { 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 [%s]\n", - pszParmName, pszParmValue, new_list[i], - str_list_join_shell(mem_ctx, *(const char ***)parm_ptr, ' '))); - return false; - + *(const char ***)parm_ptr = str_list_add(*(const char ***)parm_ptr, + &new_list[i][1]); } -#endif + } else if (new_list[i][0] == '-' && new_list[i][1]) { str_list_remove(*(const char ***)parm_ptr, &new_list[i][1]); } else { |