URL: https://github.com/SSSD/sssd/pull/196
Author: mzidek-rh
 Title: #196: SSSD-1.15 - config-check: Message when sssd.conf is missing
Action: opened

PR body:
"""
SSSD 1.15 version for patch recently pushed to 1.14.

sssctl config-check should print a message for user
if no sssd.conf was found.

Resolves:
https://pagure.io/SSSD/sssd/issue/3330
"""

To pull the PR as Git branch:
git remote add ghsssd https://github.com/SSSD/sssd
git fetch ghsssd pull/196/head:pr196
git checkout pr196
From a44a1d81d8ff7d1a1da4c1d0c22033b50022ab23 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzi...@redhat.com>
Date: Tue, 14 Mar 2017 15:43:41 +0100
Subject: [PATCH] config-check: Message when sssd.conf is missing

sssctl config-check should print a message for user
if no sssd.conf was found.

Resolves:
https://pagure.io/SSSD/sssd/issue/3330
---
 src/tools/sssctl/sssctl_config.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/tools/sssctl/sssctl_config.c b/src/tools/sssctl/sssctl_config.c
index 630df3c..1e601e7 100644
--- a/src/tools/sssctl/sssctl_config.c
+++ b/src/tools/sssctl/sssctl_config.c
@@ -63,7 +63,12 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline,
 
     /* Open config file */
     ret = sss_ini_config_file_open(init_data, SSSD_CONFIG_FILE);
-    if (ret != EOK) {
+    if (ret == ENOENT) {
+        PRINT("File %1$s does not exist. Default configuration will be "
+               "generated on next SSSD startup.\n", SSSD_CONFIG_FILE);
+        ret = EOK;
+        goto done;
+    } else if (ret != EOK) {
         DEBUG(SSSDBG_TRACE_FUNC,
               "sss_ini_config_file_open failed: %s [%d]\n",
               sss_strerror(ret),
_______________________________________________
sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org
To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org

Reply via email to