From 6347e38d95c3f28c27323acb585d99909a2b98d9 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Tue, 3 Feb 2015 19:43:46 -0500
Subject: [PATCH 303/305] Ticket 47963 - memberof skip nested groups breaks the
plugin
Bug Description: The previous patch broke the memberOf plugin - it
basically wouldn't do anything. The skip was being
done too early.
Fix Description: Move the "recursion skip" to the appropriate location.
https://fedorahosted.org/389/ticket/47963
Reviewed by: nhosoi(Thanks!)
(cherry picked from commit 70d5fe69846482bb82723e300389469924c2cd85)
(cherry picked from commit ffc784c20554edcfa496472a3b438e31d20d6a4a)
---
ldap/servers/plugins/memberof/memberof.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 0098829..7cb0e27 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -1721,6 +1721,7 @@ int memberof_get_groups_callback(Slapi_Entry *e, void *callback_data)
char *group_dn = slapi_entry_get_ndn(e);
Slapi_Value *group_dn_val = 0;
Slapi_ValueSet *groupvals = *((memberof_get_groups_data*)callback_data)->groupvals;
+ MemberOfConfig *config = ((memberof_get_groups_data*)callback_data)->config;
int rc = 0;
if(slapi_is_shutting_down()){
@@ -1778,10 +1779,11 @@ int memberof_get_groups_callback(Slapi_Entry *e, void *callback_data)
* by the valueset. */
slapi_valueset_add_value_ext(groupvals, group_dn_val, SLAPI_VALUE_FLAG_PASSIN);
- /* now recurse to find parent groups of e */
- memberof_get_groups_r(((memberof_get_groups_data*)callback_data)->config,
- group_sdn, callback_data);
-
+ if(!config->skip_nested || config->fixup_task){
+ /* now recurse to find parent groups of e */
+ memberof_get_groups_r(((memberof_get_groups_data*)callback_data)->config,
+ group_sdn, callback_data);
+ }
bail:
return rc;
}
@@ -2468,10 +2470,8 @@ int memberof_fix_memberof_callback(Slapi_Entry *e, void *callback_data)
memberof_del_dn_data del_data = {0, config->memberof_attr};
Slapi_ValueSet *groups = 0;
- if(!config->skip_nested || config->fixup_task){
- /* get a list of all of the groups this user belongs to */
- groups = memberof_get_groups(config, sdn);
- }
+ /* get a list of all of the groups this user belongs to */
+ groups = memberof_get_groups(config, sdn);
/* If we found some groups, replace the existing memberOf attribute
* with the found values. */
--
1.9.3