summaryrefslogtreecommitdiff
path: root/lib/pid_output.c
diff options
context:
space:
mode:
authorDenis Ovsienko <linux@pilot.org.ua>2007-10-04 15:09:19 +0000
committerDenis Ovsienko <linux@pilot.org.ua>2007-10-04 15:09:19 +0000
commit7593fddfa1558d086e3142ad96cf2790007f5d84 (patch)
treec0eacd4abe36cfe0e62c2a8faf5ac300b9d661e7 /lib/pid_output.c
parenta3aaf5b0ceb8c5b3821793333b4057df872fbedd (diff)
+ pidfiles are now always created with 0644 perms instead if LOGFILE_MASK (0600)
Diffstat (limited to 'lib/pid_output.c')
-rw-r--r--lib/pid_output.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/pid_output.c b/lib/pid_output.c
index a098c63c..5261babc 100644
--- a/lib/pid_output.c
+++ b/lib/pid_output.c
@@ -25,6 +25,7 @@
#include <log.h>
#include "version.h"
+#define PIDFILE_MASK 0644
#ifndef HAVE_FCNTL
pid_t
@@ -36,7 +37,7 @@ pid_output (const char *path)
pid = getpid();
- oldumask = umask(0777 & ~LOGFILE_MASK);
+ oldumask = umask(0777 & ~PIDFILE_MASK);
fp = fopen (path, "w");
if (fp != NULL)
{
@@ -67,8 +68,8 @@ pid_output (const char *path)
pid = getpid ();
- oldumask = umask(0777 & ~LOGFILE_MASK);
- fd = open (path, O_RDWR | O_CREAT, LOGFILE_MASK);
+ oldumask = umask(0777 & ~PIDFILE_MASK);
+ fd = open (path, O_RDWR | O_CREAT, PIDFILE_MASK);
if (fd < 0)
{
zlog_err("Can't create pid lock file %s (%s), exiting",