486339
From d18b1d105c928363eddec87af37fda0757cfb440 Mon Sep 17 00:00:00 2001
486339
From: Alexander Bokovoy <abokovoy@redhat.com>
486339
Date: Thu, 1 Jul 2021 11:37:38 +0300
486339
Subject: [PATCH] back-sch: reuse backend_should_descend
486339
486339
When backend_search_find_set_dn_cb() is called, use the same logic as in
486339
other callbacks -- identify whether we should descend into the group by
486339
using backend_should_descend().
486339
486339
The issue was introduced in 2015 with ID Views support but was masked
486339
until 61ea8f6a104da25329e301a8f56944f860de8177 as we always felt through
486339
to the full scan of the groups anyway. with the latter change the
486339
fell-through part was removed.
486339
486339
Resolves: rhbz#1958909
486339
486339
Signed-off-by: Alexander Bokovoy <abokovoy@redhat.com>
486339
Signed-off-by: Thierry Bordaz <tbordaz@redhat.com>
486339
---
486339
 src/back-sch.c | 5 +++--
486339
 1 file changed, 3 insertions(+), 2 deletions(-)
486339
486339
diff --git a/src/back-sch.c b/src/back-sch.c
486339
index d806627..0ed06fb 100644
486339
--- a/src/back-sch.c
486339
+++ b/src/back-sch.c
486339
@@ -1369,8 +1369,9 @@ backend_search_find_set_dn_cb(const char *group, void *cb_data)
486339
 
486339
 	/* Check the group itself. */
486339
 	group_dn = slapi_sdn_new_dn_byval(group);
486339
-	if (slapi_sdn_scope_test(group_dn, cbdata->target_dn,
486339
-				 cbdata->scope) == 1) {
486339
+	if (backend_should_descend(group_dn,
486339
+				   cbdata->target_dn,
486339
+				   cbdata->scope)) {
486339
 		cbdata->answer = TRUE;
486339
 		slapi_sdn_free(&group_dn);
486339
 		return TRUE;
486339
-- 
486339
2.31.1
486339