andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
93ba16
From 83f2b13037731f09e0e1db4d586d6afffb6bd536 Mon Sep 17 00:00:00 2001
93ba16
From: Mark Reynolds <mreynolds@redhat.com>
93ba16
Date: Thu, 6 Aug 2020 14:50:19 -0400
93ba16
Subject: [PATCH 2/5] Issue 51233 - ds-replcheck crashes in offline mode
93ba16
93ba16
Bug Description:  When processing all the DN's found in the Master LDIF
93ba16
                  it is possible that the LDIF is not in the expected
93ba16
                  order and ldifsearch fails (crashing the tool).
93ba16
93ba16
Fix Description:  If ldifsearch does not find an entry, start from the
93ba16
                  beginning of the LDIF and try again.
93ba16
93ba16
relates: https://pagure.io/389-ds-base/issue/51233
93ba16
93ba16
Reviewed by: spichugi(Thanks!)
93ba16
---
93ba16
 ldap/admin/src/scripts/ds-replcheck | 4 ++++
93ba16
 1 file changed, 4 insertions(+)
93ba16
93ba16
diff --git a/ldap/admin/src/scripts/ds-replcheck b/ldap/admin/src/scripts/ds-replcheck
93ba16
index aea32fdb4..eef68e174 100755
93ba16
--- a/ldap/admin/src/scripts/ds-replcheck
93ba16
+++ b/ldap/admin/src/scripts/ds-replcheck
93ba16
@@ -637,6 +637,10 @@ def do_offline_report(opts, output_file=None):
93ba16
     missing = False
93ba16
     for dn in master_dns:
93ba16
         mresult = ldif_search(MLDIF, dn)
93ba16
+        if mresult['entry'] is None and mresult['conflict'] is None and not mresult['tombstone']:
93ba16
+            # Try from the beginning
93ba16
+            MLDIF.seek(0)
93ba16
+            mresult = ldif_search(MLDIF, dn)
93ba16
         rresult = ldif_search(RLDIF, dn)
93ba16
 
93ba16
         if dn in replica_dns:
93ba16
-- 
93ba16
2.26.2
93ba16