From a54c7b1ccfd6e0a049da26afc3a2e87b332ec40e Mon Sep 17 00:00:00 2001 From: Pavel Reichl Date: Wed, 5 Feb 2014 17:32:20 +0000 Subject: MONITOR: Incorrect permissions on sssd.conf Print user friendly warning when permissions on sssd.conf are incorrect and provide hint. Resolves: https://fedorahosted.org/sssd/ticket/2208 Reviewed-by: Stephen Gallagher (cherry picked from commit b3cc9b98966fa2d90172348c334b3b70c5261ab3) --- src/monitor/monitor.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/monitor/monitor.c b/src/monitor/monitor.c index 09f530d26..72a8b7c4a 100644 --- a/src/monitor/monitor.c +++ b/src/monitor/monitor.c @@ -84,6 +84,11 @@ */ #define KRB5_RCACHE_DIR_DISABLE "__LIBKRB5_DEFAULTS__" +/* Warning messages */ +#define CONF_FILE_PERM_ERROR_MSG "Cannot read config file %s. Please check "\ + "if permissions are 0600 and the file is "\ + "owned by root.root." + int cmdline_debug_level; int cmdline_debug_timestamps; int cmdline_debug_microseconds; @@ -2798,7 +2803,8 @@ int main(int argc, const char *argv[]) case EPERM: case EACCES: DEBUG(SSSDBG_CRIT_FAILURE, - ("Insufficient permissions to read configuration file.\n")); + (CONF_FILE_PERM_ERROR_MSG, config_file)); + sss_log(SSS_LOG_ALERT, CONF_FILE_PERM_ERROR_MSG, config_file); break; default: DEBUG(SSSDBG_CRIT_FAILURE, -- cgit