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