about summary refs log tree commit diff
path: root/src/supervision
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-12-02 11:23:49 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-12-02 11:23:49 +0000
commitffb0a8fd2045bb8f7f097905cb9d0814803c6060 (patch)
treec012cdeff13f07176058ed70168292246f722815 /src/supervision
parent8873c303fefaed17f6777989f929612a99675a00 (diff)
downloads6-ffb0a8fd2045bb8f7f097905cb9d0814803c6060.tar.gz
s6-ffb0a8fd2045bb8f7f097905cb9d0814803c6060.tar.xz
s6-ffb0a8fd2045bb8f7f097905cb9d0814803c6060.zip
Fix lock permissions
Diffstat (limited to 'src/supervision')
-rw-r--r--src/supervision/s6-supervise.c10
-rw-r--r--src/supervision/s6-svscan.c2
2 files changed, 6 insertions, 6 deletions
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index 112ccea..a8be37d 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -7,9 +7,9 @@
 #include <string.h>
 #include <strings.h>
 #include <errno.h>
-#include <fcntl.h>
 #include <limits.h>
 #include <signal.h>
+#include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/wait.h>
 
@@ -142,9 +142,9 @@ static void bail (void)
 
 static void closethem (void)
 {
-  fd_close(0) ;
-  fd_close(1) ;
-  fd_close(2) ;
+  close(0) ;
+  close(1) ;
+  close(2) ;
   open_readb("/dev/null") ;
   open_write("/dev/null") ; ndelay_off(1) ;
   open_write("/dev/null") ; ndelay_off(2) ;
@@ -685,7 +685,7 @@ static inline int control_init (void)
   }
 
   trymkdir(S6_SUPERVISE_CTLDIR) ;
-  fdlck = open(LCK, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0600) ;
+  fdlck = open3(LCK, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0644) ;
   if (fdlck < 0) strerr_diefu1sys(111, "open " LCK) ;
   r = fd_lock(fdlck, 1, 1) ;
   if (r < 0) strerr_diefu1sys(111, "lock " LCK) ;
diff --git a/src/supervision/s6-svscan.c b/src/supervision/s6-svscan.c
index 1d17a3a..0a3c286 100644
--- a/src/supervision/s6-svscan.c
+++ b/src/supervision/s6-svscan.c
@@ -497,7 +497,7 @@ static inline int control_init (void)
       strerr_dief1x(100, S6_SVSCAN_CTLDIR " exists and is not a directory") ;
   }
 
-  fdlck = open(LCK, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0600) ;
+  fdlck = open(LCK, O_WRONLY | O_NONBLOCK | O_CREAT | O_CLOEXEC, 0644) ;
   if (fdlck < 0) strerr_diefu1sys(111, "open " LCK) ;
   r = fd_lock(fdlck, 1, 1) ;
   if (r < 0) strerr_diefu1sys(111, "lock " LCK) ;