From dad90587794fdc2112f2099d5f6cdd9e138781be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C5=BDidek?= Date: Wed, 13 Jul 2016 20:02:47 +0200 Subject: [PATCH 20/27] sdap: Fix ldap_rfc_2307_fallback_to_local_users MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We wrongly tried to store empty user attributes instead of the local user attributes with ldap_rfc_2307_fallback_to_local_users set to true. This gave us bad initgroups results and caused segfaults. Resolves: https://fedorahosted.org/sssd/ticket/3045 Reviewed-by: Lukáš Slebodník (cherry picked from commit aa8ec3758d885d6ae4088174369d30f8493ec898) --- src/providers/ldap/sdap_async_initgroups.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/providers/ldap/sdap_async_initgroups.c b/src/providers/ldap/sdap_async_initgroups.c index d14563cb045a0ce34b72051744894362fc32d003..17593f0a268813662d6c7fbf658b1eb4599ce3c3 100644 --- a/src/providers/ldap/sdap_async_initgroups.c +++ b/src/providers/ldap/sdap_async_initgroups.c @@ -2893,6 +2893,9 @@ static void sdap_get_initgr_user(struct tevent_req *subreq) (dp_opt_get_bool(state->opts->basic, SDAP_RFC2307_FALLBACK_TO_LOCAL_USERS) == true)) { ret = sdap_fallback_local_user(state, state->shortname, -1, &usr_attrs); + if (ret == EOK) { + state->orig_user = usr_attrs[0]; + } } else { ret = ENOENT; } -- 2.4.11