From 72f468088f8d58443e307a2f8b35f3058ae2dc5e Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Thu, 28 Jun 2007 10:32:52 +0000 Subject: r23641: 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 (This used to be commit 00be68a8416405e12a27186506f9eb15bca055b3) --- source3/lib/util_reg.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'source3/lib/util_reg.c') diff --git a/source3/lib/util_reg.c b/source3/lib/util_reg.c index ed9f0a6817..cf0564509b 100644 --- a/source3/lib/util_reg.c +++ b/source3/lib/util_reg.c @@ -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; +} -- cgit