1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-18 06:04:06 +03:00

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
This commit is contained in:
Andrew Bartlett 2013-04-05 12:01:17 +11:00
parent 7955bf473f
commit f7756137e8

View File

@ -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