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

python samba-tool drs: Correctly print KCC references to deleted servers

Tested against Windows 2008R2, presumably before the KCC ran.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Andrew Bartlett 2013-06-10 11:43:18 +10:00 committed by Stefan Metzmacher
parent 3e66cb7d77
commit eec29db7c2

View File

@ -170,10 +170,19 @@ class cmd_drs_showrepl(Command):
self.message("==== KCC CONNECTION OBJECTS ====\n")
for c in conn:
c_rdn, sep, c_server_dn = c['fromServer'][0].partition(',')
c_server_res = self.samdb.search(base=c_server_dn, scope=ldb.SCOPE_BASE, attrs=["dnsHostName"])
c_server_dns = c_server_res[0]["dnsHostName"][0]
self.message("Connection --")
c_rdn, sep, c_server_dn = c['fromServer'][0].partition(',')
try:
c_server_res = self.samdb.search(base=c_server_dn, scope=ldb.SCOPE_BASE, attrs=["dnsHostName"])
c_server_dns = c_server_res[0]["dnsHostName"][0]
except ldb.LdbError, (errno, _):
if errno == ldb.ERR_NO_SUCH_OBJECT:
self.message("\tWARNING: Connection to DELETED server!")
c_server_dns = ""
except KeyError:
c_server_dns = ""
self.message("\tConnection name: %s" % c['name'][0])
self.message("\tEnabled : %s" % attr_default(c, 'enabledConnection', 'TRUE'))
self.message("\tServer DNS name : %s" % c_server_dns)