Blame SOURCES/0078-sssctl-Generic-help-for-cache-upgrade-and-config-che.patch

b2d430
From 44b93ae9e80652661da7c1f35aa5aec532e6f04d Mon Sep 17 00:00:00 2001
b2d430
From: =?UTF-8?q?Michal=20=C5=BDidek?= <mzidek@redhat.com>
b2d430
Date: Tue, 26 Jul 2016 16:35:55 +0200
b2d430
Subject: [PATCH 78/82] sssctl: Generic help for cache-upgrade and config-check
b2d430
MIME-Version: 1.0
b2d430
Content-Type: text/plain; charset=UTF-8
b2d430
Content-Transfer-Encoding: 8bit
b2d430
b2d430
sssctl COMMAND --help should print at least
b2d430
generic help, even if the command does not
b2d430
accept any command specific options.
b2d430
b2d430
Resolves:
b2d430
https://fedorahosted.org/sssd/ticket/3086
b2d430
b2d430
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
b2d430
---
b2d430
 src/tools/sssctl/sssctl_config.c | 6 ++++++
b2d430
 src/tools/sssctl/sssctl_data.c   | 6 ++++++
b2d430
 2 files changed, 12 insertions(+)
b2d430
b2d430
diff --git a/src/tools/sssctl/sssctl_config.c b/src/tools/sssctl/sssctl_config.c
b2d430
index a66d7749c4aee9bd00c0ad2d296292658ffdb9b2..630df3c8ff5368ef253bb9753380e94c8c0a307d 100644
b2d430
--- a/src/tools/sssctl/sssctl_config.c
b2d430
+++ b/src/tools/sssctl/sssctl_config.c
b2d430
@@ -47,6 +47,12 @@ errno_t sssctl_config_check(struct sss_cmdline *cmdline,
b2d430
     char **strs = NULL;
b2d430
     TALLOC_CTX *tmp_ctx = NULL;
b2d430
 
b2d430
+    ret = sss_tool_popt(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL);
b2d430
+    if (ret != EOK) {
b2d430
+        DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command arguments\n");
b2d430
+        return ret;
b2d430
+    }
b2d430
+
b2d430
     tmp_ctx = talloc_new(NULL);
b2d430
     init_data = sss_ini_initdata_init(tmp_ctx);
b2d430
     if (!init_data) {
b2d430
diff --git a/src/tools/sssctl/sssctl_data.c b/src/tools/sssctl/sssctl_data.c
b2d430
index a26ddd8d5200319e75282b738791cf270f0d75a8..72823ab254344bba6f7679882a733b6ef2250525 100644
b2d430
--- a/src/tools/sssctl/sssctl_data.c
b2d430
+++ b/src/tools/sssctl/sssctl_data.c
b2d430
@@ -266,6 +266,12 @@ errno_t sssctl_cache_upgrade(struct sss_cmdline *cmdline,
b2d430
     struct sysdb_upgrade_ctx db_up_ctx;
b2d430
     errno_t ret;
b2d430
 
b2d430
+    ret = sss_tool_popt(cmdline, NULL, SSS_TOOL_OPT_OPTIONAL, NULL, NULL);
b2d430
+    if (ret != EOK) {
b2d430
+        DEBUG(SSSDBG_CRIT_FAILURE, "Unable to parse command arguments\n");
b2d430
+        return ret;
b2d430
+    }
b2d430
+
b2d430
     if (sss_deamon_running()) {
b2d430
         return ERR_SSSD_RUNNING;
b2d430
     }
b2d430
-- 
b2d430
2.4.11
b2d430