Blame SOURCES/0004-cache_req-return-success-for-autofs-when-ENOENT-is-r.patch

160847
From bb94a18f0f0cba1e9fb5abf78b995d69e5f3c559 Mon Sep 17 00:00:00 2001
160847
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
160847
Date: Mon, 18 Oct 2021 12:29:06 +0200
160847
Subject: [PATCH] cache_req: return success for autofs when ENOENT is returned
160847
 from provider
160847
160847
The receive function should return true if data provider lookup was
160847
successfull and false if there was an error. "Not found" result is
160847
considered a successful lookup, only failure to perform a search
160847
should result in false return code.
160847
160847
Resolves: https://github.com/SSSD/sssd/issues/5832
160847
160847
Reviewed-by: Pawel Polawski <ppolawsk@redhat.com>
160847
---
160847
 .../common/cache_req/plugins/cache_req_autofs_entry_by_name.c   | 2 +-
160847
 .../common/cache_req/plugins/cache_req_autofs_map_by_name.c     | 2 +-
160847
 .../common/cache_req/plugins/cache_req_autofs_map_entries.c     | 2 +-
160847
 3 files changed, 3 insertions(+), 3 deletions(-)
160847
160847
diff --git a/src/responder/common/cache_req/plugins/cache_req_autofs_entry_by_name.c b/src/responder/common/cache_req/plugins/cache_req_autofs_entry_by_name.c
160847
index 0dc6a585a..788b6708c 100644
160847
--- a/src/responder/common/cache_req/plugins/cache_req_autofs_entry_by_name.c
160847
+++ b/src/responder/common/cache_req/plugins/cache_req_autofs_entry_by_name.c
160847
@@ -97,7 +97,7 @@ cache_req_autofs_entry_by_name_dp_recv(struct tevent_req *subreq,
160847
 
160847
     ret = sbus_call_dp_autofs_GetEntry_recv(subreq);
160847
 
160847
-    if (ret == ERR_MISSING_DP_TARGET) {
160847
+    if (ret == ERR_MISSING_DP_TARGET || ret == ENOENT) {
160847
         ret = EOK;
160847
     }
160847
 
160847
diff --git a/src/responder/common/cache_req/plugins/cache_req_autofs_map_by_name.c b/src/responder/common/cache_req/plugins/cache_req_autofs_map_by_name.c
160847
index 6a665c58e..5d82641cc 100644
160847
--- a/src/responder/common/cache_req/plugins/cache_req_autofs_map_by_name.c
160847
+++ b/src/responder/common/cache_req/plugins/cache_req_autofs_map_by_name.c
160847
@@ -93,7 +93,7 @@ cache_req_autofs_map_by_name_dp_recv(struct tevent_req *subreq,
160847
 
160847
     ret = sbus_call_dp_autofs_GetMap_recv(subreq);
160847
 
160847
-    if (ret == ERR_MISSING_DP_TARGET) {
160847
+    if (ret == ERR_MISSING_DP_TARGET || ret == ENOENT) {
160847
         ret = EOK;
160847
     }
160847
 
160847
diff --git a/src/responder/common/cache_req/plugins/cache_req_autofs_map_entries.c b/src/responder/common/cache_req/plugins/cache_req_autofs_map_entries.c
160847
index 46776b980..29f289723 100644
160847
--- a/src/responder/common/cache_req/plugins/cache_req_autofs_map_entries.c
160847
+++ b/src/responder/common/cache_req/plugins/cache_req_autofs_map_entries.c
160847
@@ -125,7 +125,7 @@ cache_req_autofs_map_entries_dp_recv(struct tevent_req *subreq,
160847
 
160847
     ret = sbus_call_dp_autofs_Enumerate_recv(subreq);
160847
 
160847
-    if (ret == ERR_MISSING_DP_TARGET) {
160847
+    if (ret == ERR_MISSING_DP_TARGET || ret == ENOENT) {
160847
         ret = EOK;
160847
     }
160847
 
160847
-- 
160847
2.26.3
160847