Blame SOURCES/0025-Issue-4837-persistent-search-returns-entries-even-wh.patch

b8da0b
From 31d53e7da585723e66b838dcf34b77ea7c9968c6 Mon Sep 17 00:00:00 2001
b8da0b
From: tbordaz <tbordaz@redhat.com>
b8da0b
Date: Wed, 21 Jul 2021 09:16:30 +0200
b8da0b
Subject: [PATCH] Issue 4837 - persistent search returns entries even when an
b8da0b
 error is returned by content-sync-plugin (#4838)
b8da0b
b8da0b
Bug description:
b8da0b
	When a ldap client sends a sync request control, the server response may contain a sync state control.
b8da0b
        If the server fails to create the control the search should fail.
b8da0b
b8da0b
Fix description:
b8da0b
	In case the server fails to create the response control
b8da0b
        logs the failure of the pre_search
b8da0b
b8da0b
relates: https://github.com/389ds/389-ds-base/issues/4837
b8da0b
b8da0b
Reviewed by: Simon Pichugin
b8da0b
b8da0b
Platforms tested: RH8.4
b8da0b
---
b8da0b
 ldap/servers/plugins/sync/sync_refresh.c | 2 +-
b8da0b
 1 file changed, 1 insertion(+), 1 deletion(-)
b8da0b
b8da0b
diff --git a/ldap/servers/plugins/sync/sync_refresh.c b/ldap/servers/plugins/sync/sync_refresh.c
b8da0b
index 646ff760b..4cbb6a949 100644
b8da0b
--- a/ldap/servers/plugins/sync/sync_refresh.c
b8da0b
+++ b/ldap/servers/plugins/sync/sync_refresh.c
b8da0b
@@ -213,7 +213,7 @@ sync_srch_refresh_pre_entry(Slapi_PBlock *pb)
b8da0b
         Slapi_Entry *e;
b8da0b
         slapi_pblock_get(pb, SLAPI_SEARCH_RESULT_ENTRY, &e);
b8da0b
         LDAPControl **ctrl = (LDAPControl **)slapi_ch_calloc(2, sizeof(LDAPControl *));
b8da0b
-        sync_create_state_control(e, &ctrl[0], LDAP_SYNC_ADD, NULL);
b8da0b
+        rc = sync_create_state_control(e, &ctrl[0], LDAP_SYNC_ADD, NULL);
b8da0b
         slapi_pblock_set(pb, SLAPI_SEARCH_CTRLS, ctrl);
b8da0b
     }
b8da0b
     return (rc);
b8da0b
-- 
b8da0b
2.31.1
b8da0b