summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-04-05 12:01:17 +1100
committerAndrew Bartlett <abartlet@samba.org>2013-04-11 10:41:02 +0200
commitf7756137e8f8a7591c9d95482ca1fca3f6484a51 (patch)
treecf5474ada03e526d383ad624a2d2322caa0dbaee
parent7955bf473f63e31566e29299b03d44d9b450d1ae (diff)
downloadsamba-f7756137e8f8a7591c9d95482ca1fca3f6484a51.tar.gz
samba-f7756137e8f8a7591c9d95482ca1fca3f6484a51.tar.bz2
samba-f7756137e8f8a7591c9d95482ca1fca3f6484a51.zip
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 <mat@matws.net> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Apr 11 10:41:02 CEST 2013 on sn-devel-104
-rw-r--r--python/samba/provision/__init__.py9
1 files 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