[PATCH 07/22] Close file descriptors while daemonizing auditd
David Shea
dshea at redhat.com
Wed Jun 3 16:03:31 UTC 2015
This way parent processes don't try waiting for output that will never
come.
(cherry picked from commit 18888002b8b893673a5ed0554c509fe5da148447)
Related: rhbz#1188287
---
pyanaconda/isys/auditd.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/pyanaconda/isys/auditd.c b/pyanaconda/isys/auditd.c
index 24cefa8..e4435a4 100644
--- a/pyanaconda/isys/auditd.c
+++ b/pyanaconda/isys/auditd.c
@@ -104,6 +104,11 @@ int audit_daemonize(void) {
if (child < 0)
return -1;
+ /* Close stdin and friends */
+ close(STDIN_FILENO);
+ close(STDOUT_FILENO);
+ close(STDERR_FILENO);
+
#ifndef STANDALONE
for (fd = 0; fd < getdtablesize(); fd++)
close(fd);
--
2.1.0
More information about the anaconda-patches
mailing list