From c3a2e4aae7198a5ec2ac8ff028d2379668dc8aa1 Mon Sep 17 00:00:00 2001 From: Sumit Bose Date: Thu, 20 Jan 2011 17:46:35 +0100 Subject: Fix nested group handling during enumeration Nested groups where not unrolled completely during the first enumeration run because not all where present in the cache. --- src/providers/ldap/sdap_async_accounts.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/providers') diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c index 6e449dbb1..7abe3571d 100644 --- a/src/providers/ldap/sdap_async_accounts.c +++ b/src/providers/ldap/sdap_async_accounts.c @@ -1635,6 +1635,20 @@ static void sdap_get_groups_process(struct tevent_req *subreq) return; } + if (enumeration && (state->opts->schema_type != SDAP_SCHEMA_RFC2307) && + (dp_opt_get_int(state->opts->basic, SDAP_NESTING_LEVEL) != 0)) { + + DEBUG(9, ("Saving groups without members first " + "to allow unrolling of nested groups.\n")); + ret = sdap_save_groups(state, state->sysdb, state->dom, state->opts, + state->groups, state->count, false, NULL); + if (ret) { + DEBUG(2, ("Failed to store groups.\n")); + tevent_req_error(req, ret); + return; + } + } + for (i = 0; i < state->count; i++) { subreq = sdap_process_group_send(state, state->ev, state->dom, state->sysdb, state->opts, -- cgit