From 4ec429e611a85013fd548a83dd0f3c89d7ef1c96 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 4 Aug 2016 17:58:47 +0200 Subject: [PATCH 2/2] NSS: Fix offline resolution of netgroups https://fedorahosted.org/sssd/ticket/3123 If talking to the Data Provider failed, we never re-tried looking into the cache. We should consult the cache on DP failures and return cached results, if possible. --- src/responder/nss/nsssrv_netgroup.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c index e42976b245952291cd1eb36480138514e3d4ec09..37041788499c510f14c963076dbc20d554c7e2e7 100644 --- a/src/responder/nss/nsssrv_netgroup.c +++ b/src/responder/nss/nsssrv_netgroup.c @@ -674,6 +674,14 @@ static void lookup_netgr_dp_callback(uint16_t err_maj, uint32_t err_min, "Error: %u, %u, %s\n" "Will try to return what we have in cache\n", (unsigned int)err_maj, (unsigned int)err_min, err_msg); + + /* Try to fall back to cache */ + ret = lookup_netgr_step(step_ctx); + if (ret == EOK) { + /* We have cached results to return */ + nss_setent_notify_done(dctx->netgr); + } + /* Loop to the next domain if possible */ if (cmdctx->check_next && (dctx->domain = get_next_domain(dctx->domain, 0))) { -- 2.4.11