From: Matthias Dieter Wallnöfer <mwallnoefer@yahoo.de>
Date: Tue, 13 Oct 2009 16:18:50 +0000 (+0200)
Subject: s4:loadparm - adapt "realm" handling
X-Git-Url: http://repo.or.cz/w/Samba/mdw.git?a=commitdiff_plain;h=b5c1de35d8f65b918240b29e6a651035d0dd0f89

s4:loadparm - adapt "realm" handling

Add a customised function "lp_realm" which has the realm always upcased and a
function "lp_dnsdomain" which has it always lowcased.
---

diff --git a/source4/param/loadparm.c b/source4/param/loadparm.c
index f7cd95b..10eb992 100644
--- a/source4/param/loadparm.c
+++ b/source4/param/loadparm.c
@@ -648,7 +648,23 @@ _PUBLIC_ FN_GLOBAL_STRING(lp_auto_services, szAutoServices)
 _PUBLIC_ FN_GLOBAL_STRING(lp_passwd_chat, szPasswdChat)
 _PUBLIC_ FN_GLOBAL_LIST(lp_passwordserver, szPasswordServers)
 _PUBLIC_ FN_GLOBAL_LIST(lp_name_resolve_order, szNameResolveOrder)
-_PUBLIC_ FN_GLOBAL_STRING(lp_realm, szRealm)
+
+static FN_GLOBAL_STRING(_lp_realm, szRealm)
+
+_PUBLIC_ const char *lp_realm(struct loadparm_context *ctx)
+{
+	const char *str = _lp_realm(ctx);
+	strupper(discard_const_p(char, str));
+	return str;
+}
+
+_PUBLIC_ const char *lp_dnsdomain(struct loadparm_context *ctx)
+{
+	const char *str = _lp_realm(ctx);
+	strlower(discard_const_p(char, str));
+	return str;
+}
+
 _PUBLIC_ FN_GLOBAL_STRING(lp_socket_options, socket_options)
 _PUBLIC_ FN_GLOBAL_STRING(lp_workgroup, szWorkgroup)
 _PUBLIC_ FN_GLOBAL_STRING(lp_netbios_name, szNetbiosName)
@@ -657,7 +673,6 @@ _PUBLIC_ FN_GLOBAL_LIST(lp_wins_server_list, szWINSservers)
 _PUBLIC_ FN_GLOBAL_LIST(lp_interfaces, szInterfaces)
 _PUBLIC_ FN_GLOBAL_STRING(lp_socket_address, szSocketAddress)
 _PUBLIC_ FN_GLOBAL_LIST(lp_netbios_aliases, szNetbiosAliases)
-
 _PUBLIC_ FN_GLOBAL_BOOL(lp_disable_netbios, bDisableNetbios)
 _PUBLIC_ FN_GLOBAL_BOOL(lp_wins_support, bWINSsupport)
 _PUBLIC_ FN_GLOBAL_BOOL(lp_wins_dns_proxy, bWINSdnsProxy)
@@ -695,6 +710,7 @@ _PUBLIC_ FN_GLOBAL_INTEGER(lp_cli_minprotocol, cli_minprotocol)
 _PUBLIC_ FN_GLOBAL_INTEGER(lp_security, security)
 _PUBLIC_ FN_GLOBAL_BOOL(lp_paranoid_server_security, paranoid_server_security)
 _PUBLIC_ FN_GLOBAL_INTEGER(lp_announce_as, announce_as)
+
 const char *lp_servicename(const struct loadparm_service *service)
 {
 	return lp_string((const char *)service->szService);
diff --git a/source4/param/param.h b/source4/param/param.h
index 5c49f34..0c8e73e 100644
--- a/source4/param/param.h
+++ b/source4/param/param.h
@@ -115,6 +115,7 @@ const char *lp_passwd_chat(struct loadparm_context *);
 const char **lp_passwordserver(struct loadparm_context *);
 const char **lp_name_resolve_order(struct loadparm_context *);
 const char *lp_realm(struct loadparm_context *);
+const char *lp_dnsdomain(struct loadparm_context *);
 const char *lp_socket_options(struct loadparm_context *);
 const char *lp_workgroup(struct loadparm_context *);
 const char *lp_netbios_name(struct loadparm_context *);