summaryrefslogtreecommitdiff
path: root/src/ldb_modules
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2010-03-10 10:25:03 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-03-11 09:05:50 -0500
commit3ea37e96974387d57593dfb1010ee6974c7d9e1e (patch)
tree36e15d0eb32946f89a6755cb08716e8ec0f5d7b7 /src/ldb_modules
parent03dfe25c256889d66d27e079c22988f603397206 (diff)
downloadsssd-3ea37e96974387d57593dfb1010ee6974c7d9e1e.tar.gz
sssd-3ea37e96974387d57593dfb1010ee6974c7d9e1e.tar.bz2
sssd-3ea37e96974387d57593dfb1010ee6974c7d9e1e.zip
Fix memberof calculation when deleting groups
With complex hierarchies it could happen that the group just deleted was re-added by mistake to the list of groups a user is member of, causing the user to have a stray memberof value in its entry.
Diffstat (limited to 'src/ldb_modules')
-rw-r--r--src/ldb_modules/memberof.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index e0a241a5..c3f57630 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -1876,6 +1876,11 @@ static int mbof_del_anc_callback(struct ldb_request *req,
talloc_free(valdn);
continue;
}
+ /* do not re-add the original deleted entry by mistake */
+ if (ldb_dn_compare(valdn, del_ctx->first->entry_dn) == 0) {
+ talloc_free(valdn);
+ continue;
+ }
new_list->dns = talloc_realloc(new_list,
new_list->dns,
struct ldb_dn *,