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 | 10014833da868289ae28db2e7c1edfd353ca7b2b (patch) | |
tree | 968de616f6e752a48ae2891e6635dff7c9cab012 | |
parent | 7f85cff49dfe1ae90e37162d35f1a48baaa9fe79 (diff) | |
download | samba-10014833da868289ae28db2e7c1edfd353ca7b2b.tar.gz samba-10014833da868289ae28db2e7c1edfd353ca7b2b.tar.xz samba-10014833da868289ae28db2e7c1edfd353ca7b2b.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
-rw-r--r-- | source/registry/reg_smbconf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/registry/reg_smbconf.c b/source/registry/reg_smbconf.c index b17422fdcb3..3427645fa69 100644 --- a/source/registry/reg_smbconf.c +++ b/source/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); } |