summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2017-10-27 10:21:26 +0200
committerKarolin Seeger <kseeger@samba.org>2017-11-29 09:24:26 +0100
commitc1860d169cb60a1d4e40800ad6e87e81fa24fcac (patch)
tree45be0dfd768a21ce26acdb4665d3bf2fea3690df /python
parent7b67da4d84ec4b462eaca36b80a94e49f9f45739 (diff)
downloadsamba-c1860d169cb60a1d4e40800ad6e87e81fa24fcac.tar.gz
dbcheck: only calculate linked attribute helper variables once in check_dn()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13095 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> (cherry picked from commit 9a631560c9358e4f28b96fecf23a545e1d04098c)
Diffstat (limited to 'python')
-rw-r--r--python/samba/dbchecker.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 3ecb17aa4d3..dafa8443d24 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -876,6 +876,12 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
error_count = 0
obj_guid = obj['objectGUID'][0]
+ linkID, reverse_link_name = self.get_attr_linkID_and_reverse_name(attrname)
+ if reverse_link_name is not None:
+ reverse_syntax_oid = self.samdb_schema.get_syntax_oid_from_lDAPDisplayName(reverse_link_name)
+ else:
+ reverse_syntax_oid = None
+
for val in obj[attrname]:
dsdb_dn = dsdb_Dn(self.samdb, val, syntax_oid)
@@ -896,7 +902,6 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
else:
fixing_msDS_HasInstantiatedNCs = False
- linkID, reverse_link_name = self.get_attr_linkID_and_reverse_name(attrname)
if reverse_link_name is not None:
attrs.append(reverse_link_name)
@@ -1016,7 +1021,6 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
if v_guid == obj_guid:
match_count += 1
if match_count != 1:
- reverse_syntax_oid = self.samdb_schema.get_syntax_oid_from_lDAPDisplayName(reverse_link_name)
if syntax_oid == dsdb.DSDB_SYNTAX_BINARY_DN or reverse_syntax_oid == dsdb.DSDB_SYNTAX_BINARY_DN:
if not linkID & 1:
# Forward binary multi-valued linked attribute