If for some reason we are unable to open the debug file from a child
process (as was the case during some of my testing on the AD provider),
we should log a message to the syslog to alert the admin that logs are
being dropped.
From 6e0993aa1e81f6cce75ebd355ae2f52d16def5b5 Mon Sep 17 00:00:00 2001
From: Stephen Gallagher <sgall...@redhat.com>
Date: Wed, 27 Jun 2012 14:08:38 -0400
Subject: [PATCH 1/2] DEBUG: Log to syslog if we are unable to open a debug fd

---
 src/util/debug.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/util/debug.c b/src/util/debug.c
index 7816bc41afd1da76cdac9c935a541d33c279e09e..e57656d7fa21d56bd594209187ec3d5bcc72de8c 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -50,6 +50,11 @@ errno_t set_debug_file_from_fd(const int fd)
     if (dummy == NULL) {
         ret = errno;
         DEBUG(1, ("fdopen failed [%d][%s].\n", ret, strerror(ret)));
+        sss_log(SSS_LOG_ERR,
+                "Could not open debug file descriptor [%d]. "
+                "Debug messages will not be written to the file "
+                "for this child process [%s][%s]\n",
+                fd, debug_prg_name, strerror(ret));
         return ret;
     }
 
-- 
1.7.10.2

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
sssd-devel mailing list
sssd-devel@lists.fedorahosted.org
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to