diff options
author | Michael Adam <obnox@samba.org> | 2007-06-30 22:31:13 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:23:44 -0500 |
commit | ba2dc0530fa6fc7353655812be24444478e12ba1 (patch) | |
tree | 9103dc36929b8843602e970373eb694b1259ee3c | |
parent | f26abd78b17a4fc1ee3e05dd8fd89d7ae61aabad (diff) | |
download | samba-ba2dc0530fa6fc7353655812be24444478e12ba1.tar.gz samba-ba2dc0530fa6fc7353655812be24444478e12ba1.tar.bz2 samba-ba2dc0530fa6fc7353655812be24444478e12ba1.zip |
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 used to be commit 10014833da868289ae28db2e7c1edfd353ca7b2b)
-rw-r--r-- | source3/registry/reg_smbconf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/registry/reg_smbconf.c b/source3/registry/reg_smbconf.c index b17422fdcb..3427645fa6 100644 --- a/source3/registry/reg_smbconf.c +++ b/source3/registry/reg_smbconf.c @@ -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); } |