dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone

Blame SOURCES/0099-config-check-Message-when-sssd.conf-is-missing.patch

bb7cd1
From be05d577626835e3c72d71fc60e6abfa564c7cbe Mon Sep 17 00:00:00 2001
bb7cd1
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
bb7cd1
Date: Tue, 14 Mar 2017 15:43:41 +0100
bb7cd1
Subject: [PATCH 99/99] config-check: Message when sssd.conf is missing
bb7cd1
MIME-Version: 1.0
bb7cd1
Content-Type: text/plain; charset=UTF-8
bb7cd1
Content-Transfer-Encoding: 8bit
bb7cd1
bb7cd1
sssctl config-check should print a message for user
bb7cd1
if no sssd.conf was found.
bb7cd1
bb7cd1
Resolves:
bb7cd1
https://pagure.io/SSSD/sssd/issue/3330
bb7cd1
bb7cd1
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
bb7cd1
(cherry picked from commit 955574eeb3a3b937abc3df150e9bbbb79b75c889)
bb7cd1
---
bb7cd1
 src/tools/sssctl/sssctl_config.c | 5 ++++-
bb7cd1
 1 file changed, 4 insertions(+), 1 deletion(-)
bb7cd1
bb7cd1
diff --git a/src/tools/sssctl/sssctl_config.c b/src/tools/sssctl/sssctl_config.c
bb7cd1
index 630df3c8ff5368ef253bb9753380e94c8c0a307d..7e3ebf5428ce3fef232eee7334c7fd90e904b2d3 100644
bb7cd1
--- a/src/tools/sssctl/sssctl_config.c
bb7cd1
+++ b/src/tools/sssctl/sssctl_config.c
bb7cd1
@@ -63,7 +63,10 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline,
bb7cd1
 
bb7cd1
     /* Open config file */
bb7cd1
     ret = sss_ini_config_file_open(init_data, SSSD_CONFIG_FILE);
bb7cd1
-    if (ret != EOK) {
bb7cd1
+    if (ret == ENOENT) {
bb7cd1
+        ERROR("File %1$s does not exist.\n", SSSD_CONFIG_FILE);
bb7cd1
+        goto done;
bb7cd1
+    } else if (ret != EOK) {
bb7cd1
         DEBUG(SSSDBG_TRACE_FUNC,
bb7cd1
               "sss_ini_config_file_open failed: %s [%d]\n",
bb7cd1
               sss_strerror(ret),
bb7cd1
-- 
bb7cd1
2.9.3
bb7cd1