summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2013-09-25 17:09:30 -0700
committerStefan Metzmacher <metze@samba.org>2013-10-11 08:34:08 +0200
commitd5077baee26c593eb55cedf90ae440f50aa32e14 (patch)
treeae2cf11e92db75d19393a016b477555303b2048f
parent5a9265de88bd5a1e9582ce57b5c5076826e01a85 (diff)
downloadsamba-d5077baee26c593eb55cedf90ae440f50aa32e14.tar.gz
samba-d5077baee26c593eb55cedf90ae440f50aa32e14.tar.bz2
samba-d5077baee26c593eb55cedf90ae440f50aa32e14.zip
join.py: Reconnect to the DC based on the DC name in dnsHostName to allow connection to IPC$
The treeConnect&X of the GUID name fails against Windows 2003. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r--python/samba/join.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/samba/join.py b/python/samba/join.py
index 2a737bab3c..1785ab3e88 100644
--- a/python/samba/join.py
+++ b/python/samba/join.py
@@ -1193,6 +1193,10 @@ def join_subdomain(logger=None, server=None, creds=None, lp=None, site=None,
ctx.samdb = SamDB(url="ldap://%s" % ctx.server,
session_info=system_session(),
credentials=ctx.creds, lp=ctx.lp)
+ res = ctx.samdb.search(base="", scope=ldb.SCOPE_BASE, attrs=['dnsHostName'],
+ controls=[])
+ ctx.server = res[0]["dnsHostName"]
+ logger.info("DNS name of new naming master is %s" % ctx.server)
ctx.base_dn = samba.dn_from_dns_name(dnsdomain)
ctx.domsid = str(security.random_sid())