diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-09-14 22:37:11 -0700 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-09-14 22:41:09 -0700 |
commit | ffe831452b4251dec3049ab08b125d1fade5fa21 (patch) | |
tree | fc5fa576ae1f121ef0ee7220262230a2d8ce0a24 /source4 | |
parent | 7268720ad468b087dc723d4efaf38412603409cb (diff) | |
download | samba-ffe831452b4251dec3049ab08b125d1fade5fa21.tar.gz samba-ffe831452b4251dec3049ab08b125d1fade5fa21.tar.bz2 samba-ffe831452b4251dec3049ab08b125d1fade5fa21.zip |
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
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/provision.py | 9 |
1 files changed, 9 insertions, 0 deletions
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 |