summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/providers/ldap/sdap_async_initgroups.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c
index 2cda9c2e..be4384e2 100644
--- a/src/providers/ldap/sdap_async_initgroups.c
+++ b/src/providers/ldap/sdap_async_initgroups.c
@@ -2080,9 +2080,8 @@ struct tevent_req *rfc2307bis_nested_groups_send(
if ((num_groups == 0) ||
(nesting > dp_opt_get_int(opts->basic, SDAP_NESTING_LEVEL))) {
/* No parent groups to process or too deep*/
- tevent_req_done(req);
- tevent_req_post(req, ev);
- return req;
+ ret = EOK;
+ goto done;
}
state->ev = ev;
@@ -2116,7 +2115,18 @@ struct tevent_req *rfc2307bis_nested_groups_send(
goto done;
}
- ret = rfc2307bis_nested_groups_step(req);
+ while (state->group_iter < state->num_groups) {
+ ret = rfc2307bis_nested_groups_step(req);
+ if (ret == EOK) {
+ /* This group had already been looked up. Continue to
+ * another group in the same level
+ */
+ state->group_iter++;
+ continue;
+ } else {
+ goto done;
+ }
+ }
done:
if (ret == EOK) {