mirror of
https://github.com/samba-team/samba.git
synced 2025-07-27 07:42:04 +03:00
dbcheck: look in hasMasterNCs as well for determining the instance type of a NC
Forest of level 2000 don't hve the msDS-hasMasterNCs parameter Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
committed by
Andrew Bartlett
parent
abc0030f78
commit
3b79774197
@ -59,11 +59,19 @@ class dbcheck(object):
|
||||
self.rid_dn = ldb.Dn(samdb, "CN=RID Manager$,CN=System," + samdb.domain_dn())
|
||||
self.ntds_dsa = samdb.get_dsServiceName()
|
||||
|
||||
res = self.samdb.search(base=self.ntds_dsa, scope=ldb.SCOPE_BASE, attrs=['msDS-hasMasterNCs'])
|
||||
res = self.samdb.search(base=self.ntds_dsa, scope=ldb.SCOPE_BASE, attrs=['msDS-hasMasterNCs', 'hasMasterNCs'])
|
||||
if "msDS-hasMasterNCs" in res[0]:
|
||||
self.write_ncs = res[0]["msDS-hasMasterNCs"]
|
||||
else:
|
||||
self.write_ncs = None
|
||||
# If the Forest Level is less than 2003 then there is no
|
||||
# msDS-hasMasterNCs, so we fall back to hasMasterNCs
|
||||
# no need to merge as all the NCs that are in hasMasterNCs must
|
||||
# also be in msDS-hasMasterNCs (but not the opposite)
|
||||
if "hasMasterNCs" in res[0]:
|
||||
self.write_ncs = res[0]["hasMasterNCs"]
|
||||
else:
|
||||
self.write_ncs = None
|
||||
|
||||
|
||||
def check_database(self, DN=None, scope=ldb.SCOPE_SUBTREE, controls=[], attrs=['*']):
|
||||
'''perform a database check, returning the number of errors found'''
|
||||
|
Reference in New Issue
Block a user