andykimpe / rpms / 389-ds-base

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