From 0ae402cee3485fb5830ce0ffcf9e566c38fa287f Mon Sep 17 00:00:00 2001 From: Ariel Barria Date: Apr 12 2013 17:09:24 +0000 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. --- diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 7a54390..4e81f55 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; }