From a47cb2e08e4004179d2a6b5f9a9340200270fbd0 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Jun 23 2014 17:39:35 +0000 Subject: nested groups: do not fail if we get one entry twice https://fedorahosted.org/sssd/ticket/2341 Reviewed-by: Jakub Hrozek --- diff --git a/src/providers/ldap/sdap_async_nested_groups.c b/src/providers/ldap/sdap_async_nested_groups.c index 4ef3d79..040b836 100644 --- a/src/providers/ldap/sdap_async_nested_groups.c +++ b/src/providers/ldap/sdap_async_nested_groups.c @@ -1257,8 +1257,9 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save user in hash table */ ret = sdap_nested_group_hash_user(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, "User was looked up twice, " - "this shouldn't have happened.\n"); + /* the user is already present, skip it */ + talloc_zfree(entry); + ret = EOK; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save user in hash table " @@ -1299,8 +1300,9 @@ sdap_nested_group_single_step_process(struct tevent_req *subreq) /* save group in hash table */ ret = sdap_nested_group_hash_group(state->group_ctx, entry); if (ret == EEXIST) { - DEBUG(SSSDBG_TRACE_FUNC, "Group was looked up twice, " - "this shouldn't have happened.\n"); + /* the group is already present, skip it */ + talloc_zfree(entry); + ret = EOK; goto done; } else if (ret != EOK) { DEBUG(SSSDBG_CRIT_FAILURE, "Unable to save group in hash table "