svn commit: samba r23641 - in branches: SAMBA_3_0/source/lib
SAMBA_3_0/source/param SAMBA_3_0_26/source/lib
SAMBA_3_0_26/source/param
obnox at samba.org
obnox at samba.org
Thu Jun 28 10:32:53 GMT 2007
Author: obnox
Date: 2007-06-28 10:32:52 +0000 (Thu, 28 Jun 2007)
New Revision: 23641
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=23641
Log:
Put check for forbidden values in smbconf into a function.
(This will be used in a next step to prevent storing these
values in reg_smbconf.c.)
Michael
Modified:
branches/SAMBA_3_0/source/lib/util_reg.c
branches/SAMBA_3_0/source/param/loadparm.c
branches/SAMBA_3_0_26/source/lib/util_reg.c
branches/SAMBA_3_0_26/source/param/loadparm.c
Changeset:
Modified: branches/SAMBA_3_0/source/lib/util_reg.c
===================================================================
--- branches/SAMBA_3_0/source/lib/util_reg.c 2007-06-27 22:45:08 UTC (rev 23640)
+++ branches/SAMBA_3_0/source/lib/util_reg.c 2007-06-28 10:32:52 UTC (rev 23641)
@@ -117,3 +117,25 @@
string_sub(key, "\\", "/", len+1);
strupper_m(key);
}
+
+/*
+ * check whether a given value name is forbidden in registry (smbconf)
+ */
+BOOL registry_smbconf_valname_forbidden(const char *valname)
+{
+ /* hard code the list of forbidden names here for now */
+ const char *forbidden_valnames[] = {
+ "include",
+ "lock directory",
+ "lock dir",
+ NULL
+ };
+ const char **forbidden = NULL;
+
+ for (forbidden = forbidden_valnames; *forbidden != NULL; forbidden++) {
+ if (strwicmp(valname, *forbidden) == 0) {
+ return True;
+ }
+ }
+ return False;
+}
Modified: branches/SAMBA_3_0/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0/source/param/loadparm.c 2007-06-27 22:45:08 UTC (rev 23640)
+++ branches/SAMBA_3_0/source/param/loadparm.c 2007-06-28 10:32:52 UTC (rev 23641)
@@ -3165,10 +3165,7 @@
&type,
&size,
&data_p);
- if ((strwicmp(valname,"include") == 0) ||
- (strwicmp(valname, "lock directory") == 0) ||
- (strwicmp(valname, "lock dir") == 0))
- {
+ if (registry_smbconf_valname_forbidden(valname)) {
DEBUG(10, ("process_registry_globals: Ignoring "
"parameter '%s' in registry.\n", valname));
continue;
Modified: branches/SAMBA_3_0_26/source/lib/util_reg.c
===================================================================
--- branches/SAMBA_3_0_26/source/lib/util_reg.c 2007-06-27 22:45:08 UTC (rev 23640)
+++ branches/SAMBA_3_0_26/source/lib/util_reg.c 2007-06-28 10:32:52 UTC (rev 23641)
@@ -117,3 +117,25 @@
string_sub(key, "\\", "/", len+1);
strupper_m(key);
}
+
+/*
+ * check whether a given value name is forbidden in registry (smbconf)
+ */
+BOOL registry_smbconf_valname_forbidden(const char *valname)
+{
+ /* hard code the list of forbidden names here for now */
+ const char *forbidden_valnames[] = {
+ "include",
+ "lock directory",
+ "lock dir",
+ NULL
+ };
+ const char **forbidden = NULL;
+
+ for (forbidden = forbidden_valnames; *forbidden != NULL; forbidden++) {
+ if (strwicmp(valname, *forbidden) == 0) {
+ return True;
+ }
+ }
+ return False;
+}
Modified: branches/SAMBA_3_0_26/source/param/loadparm.c
===================================================================
--- branches/SAMBA_3_0_26/source/param/loadparm.c 2007-06-27 22:45:08 UTC (rev 23640)
+++ branches/SAMBA_3_0_26/source/param/loadparm.c 2007-06-28 10:32:52 UTC (rev 23641)
@@ -3166,10 +3166,7 @@
&type,
&size,
&data_p);
- if ((strwicmp(valname,"include") == 0) ||
- (strwicmp(valname, "lock directory") == 0) ||
- (strwicmp(valname, "lock dir") == 0))
- {
+ if (registry_smbconf_valname_forbidden(valname)) {
DEBUG(10, ("process_registry_globals: Ignoring "
"parameter '%s' in registry.\n", valname));
continue;
More information about the samba-cvs
mailing list