r23779: Change from v2 or later to v3 or later.
[gd/samba/.git] / source3 / lib / util_reg.c
index ed9f0a6817780f231147ac30549388dc31ad4ae1..8a944d40b81e3feca4ba3759715cfba65e54a7a3 100644 (file)
@@ -5,7 +5,7 @@
  * 
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
- * Software Foundation; either version 2 of the License, or (at your option)
+ * Software Foundation; either version 3 of the License, or (at your option)
  * any later version.
  * 
  * This program is distributed in the hope that it will be useful, but WITHOUT
@@ -117,3 +117,25 @@ void normalize_dbkey(char *key)
        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;
+}