From ffe831452b4251dec3049ab08b125d1fade5fa21 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 14 Sep 2009 22:37:11 -0700 Subject: s4:provision Prevent some invalid combinations of realm and domain We don't do well (even just trying to create duplicate servicePrincipalName values) with some of these combinations, so kill it off early before the administrator thinks it's going to work. Andrew Bartlett --- source4/scripting/python/samba/provision.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source4/scripting/python/samba/provision.py b/source4/scripting/python/samba/provision.py index e21a3cbee1..8f7859c215 100644 --- a/source4/scripting/python/samba/provision.py +++ b/source4/scripting/python/samba/provision.py @@ -421,6 +421,15 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, if not valid_netbios_name(domain): raise InvalidNetbiosName(domain) + if netbiosname.upper() == realm.upper(): + raise Exception("realm %s must not be equal to netbios domain name %s", realm, netbiosname) + + if hostname.upper() == realm.upper(): + raise Exception("realm %s must not be equal to hostname %s", realm, hostname) + + if domain.upper() == realm.upper(): + raise Exception("realm %s must not be equal to domain name %s", realm, domain) + if rootdn is None: rootdn = domaindn -- cgit