Blame SOURCES/0030-autofs-translate-ERR_OFFLINE-to-EHOSTDOWN.patch

c5e826
From 9098108a7142513fa04afdf92a2c1b3ac002c56e Mon Sep 17 00:00:00 2001
c5e826
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
c5e826
Date: Fri, 6 Mar 2020 13:44:56 +0100
c5e826
Subject: [PATCH 15/18] autofs: translate ERR_OFFLINE to EHOSTDOWN
c5e826
c5e826
So we do not publish internal error code.
c5e826
c5e826
Resolves:
c5e826
https://github.com/SSSD/sssd/issues/3413
c5e826
c5e826
Reviewed-by: Alexey Tikhonov <atikhono@redhat.com>
c5e826
---
c5e826
 src/sss_client/common.c | 15 ++++++++++++---
c5e826
 1 file changed, 12 insertions(+), 3 deletions(-)
c5e826
c5e826
diff --git a/src/sss_client/common.c b/src/sss_client/common.c
c5e826
index 902438c86..d29332939 100644
c5e826
--- a/src/sss_client/common.c
c5e826
+++ b/src/sss_client/common.c
c5e826
@@ -44,6 +44,7 @@
c5e826
 #define _(STRING) dgettext (PACKAGE, STRING)
c5e826
 #include "sss_cli.h"
c5e826
 #include "common_private.h"
c5e826
+#include "util/util_errors.h"
c5e826
 
c5e826
 #if HAVE_PTHREAD
c5e826
 #include <pthread.h>
c5e826
@@ -1054,9 +1055,17 @@ int sss_autofs_make_request(enum sss_cli_command cmd,
c5e826
                             uint8_t **repbuf, size_t *replen,
c5e826
                             int *errnop)
c5e826
 {
c5e826
-    return sss_cli_make_request_with_checks(cmd, rd, SSS_CLI_SOCKET_TIMEOUT,
c5e826
-                                            repbuf, replen, errnop,
c5e826
-                                            SSS_AUTOFS_SOCKET_NAME);
c5e826
+    enum sss_status status;
c5e826
+
c5e826
+    status = sss_cli_make_request_with_checks(cmd, rd, SSS_CLI_SOCKET_TIMEOUT,
c5e826
+                                              repbuf, replen, errnop,
c5e826
+                                              SSS_AUTOFS_SOCKET_NAME);
c5e826
+
c5e826
+    if (*errnop == ERR_OFFLINE) {
c5e826
+        *errnop = EHOSTDOWN;
c5e826
+    }
c5e826
+
c5e826
+    return status;
c5e826
 }
c5e826
 
c5e826
 int sss_ssh_make_request(enum sss_cli_command cmd,
c5e826
-- 
c5e826
2.21.3
c5e826