Blame SOURCES/0028-Issue-51233-ds-replcheck-crashes-in-offline-mode.patch

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