ldap/servers/plugins/memberof/memberof.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit ddcab8af51c8b0a787dc630bce3a0b34c446c973
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Feb 3 19:43:46 2015 -0500
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)
diff --git a/ldap/servers/plugins/memberof/memberof.c
b/ldap/servers/plugins/memberof/memberof.c
index ec96b00..4553c43 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -1732,6 +1732,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()){
@@ -1789,10 +1790,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;
}
@@ -2516,10 +2518,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. */