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