1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

param: Use the plus/minus syntax for reading in lists in s3 loadparm

This changes the behaviour the following parameters:
server services, dcerpc endpoint servers and ntvfs handler

These parameters were introduced with samba4 and are the parameters
which should utilize the newer list syntax. This allows merging
between the setting of parameters.

Change-Id: Id6226b5bede5cd4908f6718bd1b799faf881927d
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
This commit is contained in:
Garming Sam
2014-02-25 18:14:44 +13:00
committed by Andrew Bartlett
parent 93448f4be9
commit eda92c7a3d

View File

@ -2685,6 +2685,37 @@ bool lp_do_parameter(int snum, const char *pszParmName, const char *pszParmValue
}
case P_LIST:
{
char **new_list = str_list_make_v3(mem_ctx,
pszParmValue, NULL);
for (i=0; new_list[i]; i++) {
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 (*(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 {
if (i != 0) {
DEBUG(0, ("Unsupported list syntax for: %s = %s\n",
pszParmName, pszParmValue));
return false;
}
*(const char * const **)parm_ptr = (const char * const *) new_list;
break;
}
}
break;
}
case P_CMDLIST:
TALLOC_FREE(*((char ***)parm_ptr));
*(char ***)parm_ptr = str_list_make_v3(