summaryrefslogtreecommitdiffstats
path: root/src/responder/nss
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2016-08-04 17:58:47 +0200
committerLukas Slebodnik <lslebodn@redhat.com>2016-09-21 10:13:18 +0200
commita3108c5cd1ebb05c133c8e8990278ac4f4b8e25c (patch)
tree7df82caf6299c8d645179b20a071273b8c3dd892 /src/responder/nss
parentb9e155da725e711ab306ca8a96e3ba6fbda41a3a (diff)
downloadsssd-a3108c5cd1ebb05c133c8e8990278ac4f4b8e25c.tar.gz
sssd-a3108c5cd1ebb05c133c8e8990278ac4f4b8e25c.tar.xz
sssd-a3108c5cd1ebb05c133c8e8990278ac4f4b8e25c.zip
NSS: Fix offline resolution of netgroups
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. Resolves: https://fedorahosted.org/sssd/ticket/3123 Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_netgroup.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index e42976b24..49ef0f5c9 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -674,6 +674,15 @@ 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);
+ return;
+ }
+
/* Loop to the next domain if possible */
if (cmdctx->check_next
&& (dctx->domain = get_next_domain(dctx->domain, 0))) {