From f7756137e8f8a7591c9d95482ca1fca3f6484a51 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 5 Apr 2013 12:01:17 +1100 Subject: scripting-provision: Do not enforce domain != realm if we are joining an existing domain This will allow us users to join existing oddly named domains without objection from provision. Andrew Bartlett Reviewed-by: Matthieu Patou Autobuild-User(master): Andrew Bartlett Autobuild-Date(master): Thu Apr 11 10:41:02 CEST 2013 on sn-devel-104 --- python/samba/provision/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/python/samba/provision/__init__.py b/python/samba/provision/__init__.py index 252cfd9021..a84b92ff49 100644 --- a/python/samba/provision/__init__.py +++ b/python/samba/provision/__init__.py @@ -561,7 +561,8 @@ def determine_netbios_name(hostname): def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, serverrole=None, rootdn=None, domaindn=None, configdn=None, - schemadn=None, serverdn=None, sitename=None): + schemadn=None, serverdn=None, sitename=None, + domain_names_forced=False): """Guess configuration settings to use.""" if hostname is None: @@ -624,8 +625,8 @@ def guess_names(lp=None, hostname=None, domain=None, dnsdomain=None, if hostname.upper() == realm: raise ProvisioningError("guess_names: Realm '%s' must not be equal to hostname '%s'!" % (realm, hostname)) if netbiosname.upper() == realm: - raise ProvisioningError("guess_names: Realm '%s' must not be equal to netbios hostname '%s'!" % (realm, netbiosname)) - if domain == realm: + raise ProvisioningError("guess_names: Realm '%s' must not be equal to NetBIOS hostname '%s'!" % (realm, netbiosname)) + if domain == realm and not domain_names_forced: raise ProvisioningError("guess_names: Realm '%s' must not be equal to short domain name '%s'!" % (realm, domain)) if rootdn is None: @@ -1984,7 +1985,7 @@ def provision(logger, session_info, credentials, smbconf=None, names = guess_names(lp=lp, hostname=hostname, domain=domain, dnsdomain=realm, serverrole=serverrole, domaindn=domaindn, configdn=configdn, schemadn=schemadn, serverdn=serverdn, - sitename=sitename, rootdn=rootdn) + sitename=sitename, rootdn=rootdn, domain_names_forced=(samdb_fill == FILL_DRS)) paths = provision_paths_from_lp(lp, names.dnsdomain) paths.bind_gid = bind_gid -- cgit