From 7593fddfa1558d086e3142ad96cf2790007f5d84 Mon Sep 17 00:00:00 2001 From: Denis Ovsienko Date: Thu, 4 Oct 2007 15:09:19 +0000 Subject: + pidfiles are now always created with 0644 perms instead if LOGFILE_MASK (0600) --- lib/ChangeLog | 6 ++++++ lib/pid_output.c | 7 ++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 8125451f..887c7854 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2007-10-04 Denis Ovsienko + + * pid_output.c: (pid_output) stop using LOGFILE_MASK + (0600 by default), introduce and use PIDFILE_MASK (0644) + instead. + 2007-09-18 Paul Jakma * privs.c: definition of ZCAP_NET_ADMIN on Solaris should 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 #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", -- cgit v1.2.1