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