summaryrefslogtreecommitdiffstats
path: root/plugins/imklog
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-02 15:12:57 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-02 15:12:57 +0200
commiteb807027af9e126a212b0630c5873dddae48963b (patch)
tree36aab3c366d32f97eeb2f98e4040565d380f7317 /plugins/imklog
parent85c09e0c44c00be1cd91955b39fc6d0a17c72a98 (diff)
downloadrsyslog-eb807027af9e126a212b0630c5873dddae48963b.tar.gz
rsyslog-eb807027af9e126a212b0630c5873dddae48963b.tar.xz
rsyslog-eb807027af9e126a212b0630c5873dddae48963b.zip
added O_CLOEXEC to open() calls
to make sure only the minimum number of file handles is left open during a exec call. This is not a 100% solution, as there are also some fopen() calls and, more importantly, file descriptors opened by libraries. But it is better than nothing (and it was quick, at least until we run into platform hell, what we will for sure ;)).
Diffstat (limited to 'plugins/imklog')
-rw-r--r--plugins/imklog/linux.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/imklog/linux.c b/plugins/imklog/linux.c
index 198b7c0e..0dd4320d 100644
--- a/plugins/imklog/linux.c
+++ b/plugins/imklog/linux.c
@@ -144,7 +144,7 @@ static enum LOGSRC GetKernelLogSrc(void)
return(kernel);
}
- if ( (kmsg = open(_PATH_KLOG, O_RDONLY)) < 0 )
+ if ( (kmsg = open(_PATH_KLOG, O_RDONLY|O_CLOEXEC)) < 0 )
{
imklogLogIntMsg(LOG_ERR, "imklog: Cannot open proc file system, %d.\n", errno);
ksyslog(7, NULL, 0); /* TODO: check this, implement more */