guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: shepherd: Set #o640 permissions for log file of s


From: guix-commits
Subject: branch master updated: shepherd: Set #o640 permissions for log file of service in container.
Date: Fri, 02 Sep 2022 07:19:35 -0400

This is an automated email from the git hooks/post-receive script.

arunisaac pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 3e866e24f0 shepherd: Set #o640 permissions for log file of service in 
container.
3e866e24f0 is described below

commit 3e866e24f05e7e60cbd56a6240cdd2efede6eb4c
Author: Arun Isaac <arunisaac@systemreboot.net>
AuthorDate: Tue Aug 23 22:53:41 2022 +0530

    shepherd: Set #o640 permissions for log file of service in container.
    
    * gnu/build/shepherd.scm (make-forkexec-constructor/container): Set #o640
    permissions for log file.
---
 gnu/build/shepherd.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm
index f4caefce3c..9d9bfcfbc0 100644
--- a/gnu/build/shepherd.scm
+++ b/gnu/build/shepherd.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2017, 2018, 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2020 Mathieu Othacehe <othacehe@gnu.org>
 ;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la>
+;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -186,7 +187,7 @@ namespace, in addition to essential bind-mounts such /proc."
     (when log-file
       ;; Create LOG-FILE so we can map it in the container.
       (unless (file-exists? log-file)
-        (call-with-output-file log-file (const #t))
+        (close (open log-file (logior O_CREAT O_APPEND O_CLOEXEC) #o640))
         (when user
           (let ((pw (getpwnam user)))
             (chown log-file (passwd:uid pw) (passwd:gid pw))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]