1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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>
This commit is contained in:
Andrew Bartlett 2013-09-25 17:09:30 -07:00 committed by Stefan Metzmacher
parent 5a9265de88
commit d5077baee2

View File

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