diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2016-07-01 13:26:38 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2016-07-07 10:30:18 +0200 |
commit | a0b824ac01c6b58fe6055d48aa6e29e94219646d (patch) | |
tree | b9154d25cc54ef10e8ce46c58ab5e97dd368d497 /src/tools/sssctl/sssctl.c | |
parent | 1ea5a9c1930f531b21f8bc67c9c071d8ce533786 (diff) | |
download | sssd-a0b824ac01c6b58fe6055d48aa6e29e94219646d.tar.gz sssd-a0b824ac01c6b58fe6055d48aa6e29e94219646d.tar.xz sssd-a0b824ac01c6b58fe6055d48aa6e29e94219646d.zip |
TOOLS: Some tools command might not need initialization to succeed
Since we want to use the sssctl tool during upgrade, we need to amend
the tools initialization code to not error out if sysdb can't be
instantiated, but rather return errno and let the tool handle the error.
Each tool command now has a 'allowed errno' the command is able to
handle. In this patch iteration, only a single errno can be handled and
only the upgrade command is able to do so.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Diffstat (limited to 'src/tools/sssctl/sssctl.c')
-rw-r--r-- | src/tools/sssctl/sssctl.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tools/sssctl/sssctl.c b/src/tools/sssctl/sssctl.c index 58bbbf283..8e18569d8 100644 --- a/src/tools/sssctl/sssctl.c +++ b/src/tools/sssctl/sssctl.c @@ -257,20 +257,20 @@ int main(int argc, const char **argv) { struct sss_route_cmd commands[] = { SSS_TOOL_DELIMITER("SSSD Status:"), - SSS_TOOL_COMMAND("list-domains", "List available domains", sssctl_list_domains), - SSS_TOOL_COMMAND("domain-status", "Print information about domain", sssctl_domain_status), + SSS_TOOL_COMMAND("list-domains", "List available domains", 0, sssctl_list_domains), + SSS_TOOL_COMMAND("domain-status", "Print information about domain", 0, sssctl_domain_status), SSS_TOOL_DELIMITER("Information about cached content:"), - SSS_TOOL_COMMAND("user", "Information about cached user", sssctl_user), - SSS_TOOL_COMMAND("group", "Information about cached group", sssctl_group), - SSS_TOOL_COMMAND("netgroup", "Information about cached netgroup", sssctl_netgroup), + SSS_TOOL_COMMAND("user", "Information about cached user", 0, sssctl_user), + SSS_TOOL_COMMAND("group", "Information about cached group", 0, sssctl_group), + SSS_TOOL_COMMAND("netgroup", "Information about cached netgroup", 0, sssctl_netgroup), SSS_TOOL_DELIMITER("Local data tools:"), - SSS_TOOL_COMMAND("backup-local-data", "Backup local data", sssctl_backup_local_data), - SSS_TOOL_COMMAND("restore-local-data", "Restore local data from backup", sssctl_restore_local_data), - SSS_TOOL_COMMAND("remove-cache", "Backup local data and remove cached content", sssctl_remove_cache), + SSS_TOOL_COMMAND("backup-local-data", "Backup local data", 0, sssctl_backup_local_data), + SSS_TOOL_COMMAND("restore-local-data", "Restore local data from backup", 0, sssctl_restore_local_data), + SSS_TOOL_COMMAND("remove-cache", "Backup local data and remove cached content", 0, sssctl_remove_cache), SSS_TOOL_DELIMITER("Log files tools:"), - SSS_TOOL_COMMAND("remove-logs", "Remove existing SSSD log files", sssctl_remove_logs), - SSS_TOOL_COMMAND("fetch-logs", "Archive SSSD log files in tarball", sssctl_fetch_logs), - {NULL, NULL, NULL} + SSS_TOOL_COMMAND("remove-logs", "Remove existing SSSD log files", 0, sssctl_remove_logs), + SSS_TOOL_COMMAND("fetch-logs", "Archive SSSD log files in tarball", 0, sssctl_fetch_logs), + {NULL, NULL, 0, NULL} }; return sss_tool_main(argc, argv, commands, NULL); |