From 0ae402cee3485fb5830ce0ffcf9e566c38fa287f Mon Sep 17 00:00:00 2001 From: Ariel Barria Date: Wed, 3 Apr 2013 14:57:46 -0500 Subject: Confusing error messages for invalid sssd.conf https://fedorahosted.org/sssd/ticket/1625 Amending errors messages and add other error codes to be more specific and avoid confusion. --- src/monitor/monitor.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/monitor') diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 7a543908..4e81f559 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -2767,17 +2767,19 @@ int main(int argc, const char *argv[]) /* Parse config file, fail if cannot be done */ ret = load_configuration(tmp_ctx, config_file, &monitor); if (ret != EOK) { - if (ret == EPERM) { - DEBUG(1, ("Cannot read configuration file %s\n", config_file)); - sss_log(SSS_LOG_ALERT, - "Cannot read config file %s, please check if permissions " - "are 0600 and the file is owned by root.root", config_file); - } else { - DEBUG(SSSDBG_CRIT_FAILURE, ("Error loading configuration database: " - "[%d]: %s\n", ret, strerror(ret))); + switch (ret) { + case EPERM: + case EACCES: + DEBUG(SSSDBG_CRIT_FAILURE, + ("Insufficient permissions to read configuration file.\n")); + break; + default: + DEBUG(SSSDBG_CRIT_FAILURE, + ("SSSD couldn't load the configuration database.\n")); sss_log(SSS_LOG_ALERT, - "Cannot load configuration database: [%d]: %s", + "SSSD couldn't load the configuration database [%d]: %s.\n", ret, strerror(ret)); + break; } return 4; } -- cgit