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