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