summaryrefslogtreecommitdiff
path: root/python/samba/dbchecker.py
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2019-02-28 18:16:27 +0100
committerAndrew Bartlett <abartlet@samba.org>2019-03-14 02:12:20 +0000
commit598e38d2a5e0832429ba65b4e55bf7127618f894 (patch)
tree19975c7386842f345adfe89bb23148bf08420c4e /python/samba/dbchecker.py
parente388e599495b6d7c38b8b6966332e27f8b958783 (diff)
downloadsamba-598e38d2a5e0832429ba65b4e55bf7127618f894.tar.gz
dbcheck: add find_repl_attid() helper function
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13816 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba/dbchecker.py')
-rw-r--r--python/samba/dbchecker.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py
index 35cff3668f2..88a9ddb0ab9 100644
--- a/python/samba/dbchecker.py
+++ b/python/samba/dbchecker.py
@@ -1501,6 +1501,13 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
return error_count
+ def find_repl_attid(self, repl, attid):
+ for o in repl.ctr.array:
+ if o.attid == attid:
+ return o
+
+ return None
+
def get_originating_time(self, val, attid):
'''Read metadata properties and return the originating time for
a given attributeId.
@@ -1509,11 +1516,9 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base)))
'''
repl = ndr_unpack(drsblobs.replPropertyMetaDataBlob, val)
-
- for o in repl.ctr.array:
- if o.attid == attid:
- return o.originating_change_time
-
+ o = self.find_repl_attid(repl, attid)
+ if o is not None:
+ return o.originating_change_time
return 0
def process_metadata(self, dn, val):