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