From 6a4069ec777657759b74dc7e95204b93d4e224e5 Mon Sep 17 00:00:00 2001
From: Mark Reynolds <mreynolds@redhat.com>
Date: Wed, 26 Nov 2014 16:57:05 -0500
Subject: [PATCH 277/305] Ticket 47963 - skip nested groups breaks memberof
fixup task
Bug Description: Setting memberofskipnested to "on" breaks memberOf fixup task.
Fix Description: We never want to skip nested group checking when performing
a fixup task. Add a flag to distinguish that the fixup operation
is a task, and not a delete.
https://fedorahosted.org/389/ticket/47963
Reviewed by: nkinder(Thanks!)
(cherry picked from commit d8e8119e92c6d872e317bbae5d59a08d80cb0966)
Conflicts:
ldap/servers/plugins/memberof/memberof.c
(cherry picked from commit 116dcbd8094491b0249ed0bae4c00f08b478c3ab)
---
ldap/servers/plugins/memberof/memberof.c | 5 ++++-
ldap/servers/plugins/memberof/memberof.h | 1 +
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index d81d9ab..0098829 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -2301,6 +2301,9 @@ void memberof_fixup_task_thread(void *arg)
memberof_copy_config(&configCopy, memberof_get_config());
memberof_unlock_config();
+ /* Mark this as a task operation */
+ configCopy.fixup_task = 1;
+
/* get the memberOf operation lock */
memberof_lock();
@@ -2465,7 +2468,7 @@ 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){
+ 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);
}
diff --git a/ldap/servers/plugins/memberof/memberof.h b/ldap/servers/plugins/memberof/memberof.h
index 4add6f6..79e3557 100644
--- a/ldap/servers/plugins/memberof/memberof.h
+++ b/ldap/servers/plugins/memberof/memberof.h
@@ -82,6 +82,7 @@ typedef struct memberofconfig {
Slapi_Filter *group_filter;
Slapi_Attr **group_slapiattrs;
int skip_nested;
+ int fixup_task;
} MemberOfConfig;
--
1.9.3