|
|
f35488 |
From 9a7c044dcd17b23127ddda25ff9cddc9c67fe4ca Mon Sep 17 00:00:00 2001
|
|
|
f35488 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
f35488 |
Date: Mon, 19 Mar 2018 12:47:17 +0100
|
|
|
f35488 |
Subject: [PATCH] memberof: keep memberOf attribute for nested member
|
|
|
f35488 |
|
|
|
f35488 |
If we have a member that is both direct and nested member,
|
|
|
f35488 |
memberOf attribute was removed if the direct membership
|
|
|
f35488 |
was deleted.
|
|
|
f35488 |
|
|
|
f35488 |
1)
|
|
|
f35488 |
user ----------> groupB -> groupC
|
|
|
f35488 |
-> groupA /
|
|
|
f35488 |
|
|
|
f35488 |
2)
|
|
|
f35488 |
user -> groupA -> groupB -> groupC
|
|
|
f35488 |
|
|
|
f35488 |
If we remove user->groupB from 1), we get 2) but groupB was still
|
|
|
f35488 |
removed from user memberOf attribute.
|
|
|
f35488 |
|
|
|
f35488 |
Resolves:
|
|
|
f35488 |
https://pagure.io/SSSD/sssd/issue/3636
|
|
|
f35488 |
|
|
|
f35488 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
f35488 |
(cherry picked from commit 1f5d139d103328b6e4be7dc8368abdd39a91d3a6)
|
|
|
f35488 |
|
|
|
f35488 |
Reviewed-by: Sumit Bose <sbose@redhat.com>
|
|
|
f35488 |
---
|
|
|
f35488 |
src/ldb_modules/memberof.c | 6 +-----
|
|
|
f35488 |
1 file changed, 1 insertion(+), 5 deletions(-)
|
|
|
f35488 |
|
|
|
f35488 |
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
|
|
|
f35488 |
index 5e1ff95a8..dae51938b 100644
|
|
|
f35488 |
--- a/src/ldb_modules/memberof.c
|
|
|
f35488 |
+++ b/src/ldb_modules/memberof.c
|
|
|
f35488 |
@@ -2055,11 +2055,7 @@ static int mbof_del_anc_callback(struct ldb_request *req,
|
|
|
f35488 |
talloc_free(valdn);
|
|
|
f35488 |
continue;
|
|
|
f35488 |
}
|
|
|
f35488 |
- /* do not re-add the original deleted entry by mistake */
|
|
|
f35488 |
- if (ldb_dn_compare(valdn, del_ctx->first->entry_dn) == 0) {
|
|
|
f35488 |
- talloc_free(valdn);
|
|
|
f35488 |
- continue;
|
|
|
f35488 |
- }
|
|
|
f35488 |
+
|
|
|
f35488 |
new_list->dns = talloc_realloc(new_list,
|
|
|
f35488 |
new_list->dns,
|
|
|
f35488 |
struct ldb_dn *,
|
|
|
f35488 |
--
|
|
|
f35488 |
2.21.1
|
|
|
f35488 |
|