[SSSD] [PATCH] Fix nested group handling during enumeration

Sumit Bose sbose at redhat.com
Thu Jan 20 17:14:41 UTC 2011


Hi,

this patch should fix trac ticket #779 by saving all groups without the
members first and then try to unroll the nested groups. Please review it
carefully. This patch fixes the issue for me and I hope it does not do
harm in other places.

bye,
Sumit
-------------- next part --------------
From 7e5a9f2653c5c81fd18ace59be9b6e6fc2600044 Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Thu, 20 Jan 2011 17:46:35 +0100
Subject: [PATCH] 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 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/src/providers/ldap/sdap_async_accounts.c b/src/providers/ldap/sdap_async_accounts.c
index 98a2f0e..e8f7904 100644
--- a/src/providers/ldap/sdap_async_accounts.c
+++ b/src/providers/ldap/sdap_async_accounts.c
@@ -1634,6 +1634,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,
-- 
1.7.3.3



More information about the sssd-devel mailing list