From 8715fcb39bd8086cb59d978e9a6ae18aaae1f864 Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Tue, 19 Oct 2010 15:11:10 -0400 Subject: Write log opening failures to the syslog If there is a problem with reopening the logs, it can be an audit trail issue. --- src/util/debug.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/util') diff --git a/src/util/debug.c b/src/util/debug.c index 5b6fccd68..30026dc11 100644 --- a/src/util/debug.c +++ b/src/util/debug.c @@ -132,8 +132,11 @@ int open_debug_file_ex(const char *filename, FILE **filep) if (debug_file && !filep) fclose(debug_file); old_umask = umask(0177); + errno = 0; f = fopen(logpath, "a"); if (f == NULL) { + sss_log(SSS_LOG_EMERG, "Could not open file [%s]. Error: [%d][%s]\n", + logpath, errno, strerror(errno)); free(logpath); return EIO; } -- cgit