summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-10-19 15:11:10 -0400
committerStephen Gallagher <sgallagh@redhat.com>2010-10-19 16:02:47 -0400
commit8715fcb39bd8086cb59d978e9a6ae18aaae1f864 (patch)
treefc34126c677e1576c00f50a82f4da9872b435054
parent7051a30300d12163e890e4ec4b9a765567679a8b (diff)
downloadsssd-8715fcb39bd8086cb59d978e9a6ae18aaae1f864.tar.gz
sssd-8715fcb39bd8086cb59d978e9a6ae18aaae1f864.tar.xz
sssd-8715fcb39bd8086cb59d978e9a6ae18aaae1f864.zip
Write log opening failures to the syslog
If there is a problem with reopening the logs, it can be an audit trail issue.
-rw-r--r--Makefile.am2
-rw-r--r--src/monitor/monitor_sbus.c2
-rw-r--r--src/util/debug.c3
3 files changed, 5 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index a5e6637c0..65860b634 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -504,8 +504,8 @@ sysdb_tests_LDADD = \
libsss_test_common.la
strtonum_tests_SOURCES = \
+ $(SSSD_DEBUG_OBJ) \
src/tests/strtonum-tests.c \
- src/util/debug.c \
src/util/strtonum.c
strtonum_tests_CFLAGS = \
$(AM_CFLAGS) \
diff --git a/src/monitor/monitor_sbus.c b/src/monitor/monitor_sbus.c
index 43e5b685e..034cd46d2 100644
--- a/src/monitor/monitor_sbus.c
+++ b/src/monitor/monitor_sbus.c
@@ -184,7 +184,7 @@ int monitor_common_rotate_logs(DBusMessage *message,
ret = rotate_debug_files();
if (ret) {
- DEBUG(1, ("Could not rotate debug files!\n"));
+ sss_log(SSS_LOG_ALERT, "Could not rotate debug files!\n");
return ret;
}
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;
}