diff options
author | Stefan Metzmacher <metze@samba.org> | 2019-02-28 18:16:27 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2019-03-28 12:19:13 +0000 |
commit | 2272dea483ecb0d43cc4d155b92e34a07a49146d (patch) | |
tree | 24ab6a441787c8913cac60ba1ff1e1f1a13a3cac | |
parent | 0473eab6862b41a68e980d451f3008568ce634f2 (diff) | |
download | samba-2272dea483ecb0d43cc4d155b92e34a07a49146d.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>
(cherry picked from commit 598e38d2a5e0832429ba65b4e55bf7127618f894)
-rw-r--r-- | python/samba/dbchecker.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/python/samba/dbchecker.py b/python/samba/dbchecker.py index a11e76038e5..4b21cab80b7 100644 --- a/python/samba/dbchecker.py +++ b/python/samba/dbchecker.py @@ -1454,6 +1454,12 @@ 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 @@ -1463,12 +1469,9 @@ newSuperior: %s""" % (str(from_dn), str(to_rdn), str(to_base))) ''' repl = ndr_unpack(drsblobs.replPropertyMetaDataBlob, str(val)) - obj = repl.ctr - - 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): |