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