1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

r23667: Prevent storing of forbidden parameter names in registry

configuration as values. I would really like to check whether
the valuename is a valid parameter name (with lp_parameter_is_valid)
here, but unfortunately, regedit cereates new values as
"New Value #1" (and so on) first, before dropping into the
rename box. So this is impossible here.

Michael
This commit is contained in:
Michael Adam 2007-06-30 22:31:13 +00:00 committed by Gerald (Jerry) Carter
parent 7f85cff49d
commit 10014833da

View File

@ -42,6 +42,19 @@ static int smbconf_fetch_values( const char *key, REGVAL_CTR *val )
static BOOL smbconf_store_values( const char *key, REGVAL_CTR *val )
{
int i;
int num_values = regval_ctr_numvals(val);
for (i=0; i < num_values; i++) {
REGISTRY_VALUE *theval = regval_ctr_specific_value(val, i);
const char *valname = regval_name(theval);
if (registry_smbconf_valname_forbidden(valname)) {
DEBUG(0, ("smbconf_store_values: value '%s' forbidden "
"in registry.\n", valname));
return False;
}
}
return regdb_ops.store_values(key, val);
}