diff options
| author | Arun Isaac <arunisaac@systemreboot.net> | 2022-08-23 22:53:41 +0530 |
|---|---|---|
| committer | Arun Isaac <arunisaac@systemreboot.net> | 2022-09-02 16:32:16 +0530 |
| commit | 3e866e24f05e7e60cbd56a6240cdd2efede6eb4c (patch) | |
| tree | 0cf77c9eb7dbf3d8c97331406d18aabcb56d188c /gnu/build | |
| parent | 162c7e1bc621b53152b1fa5b893a500107efd4e9 (diff) | |
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.
Diffstat (limited to 'gnu/build')
| -rw-r--r-- | gnu/build/shepherd.scm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gnu/build/shepherd.scm b/gnu/build/shepherd.scm index f4caefce3c7..9d9bfcfbc04 100644 --- a/gnu/build/shepherd.scm +++ b/gnu/build/shepherd.scm | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | ;;; Copyright © 2017, 2018, 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2017, 2018, 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2020 Mathieu Othacehe <othacehe@gnu.org> | 3 | ;;; Copyright © 2020 Mathieu Othacehe <othacehe@gnu.org> |
| 4 | ;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la> | 4 | ;;; Copyright © 2022 Leo Nikkilä <hello@lnikki.la> |
| 5 | ;;; Copyright © 2022 Arun Isaac <arunisaac@systemreboot.net> | ||
| 5 | ;;; | 6 | ;;; |
| 6 | ;;; This file is part of GNU Guix. | 7 | ;;; This file is part of GNU Guix. |
| 7 | ;;; | 8 | ;;; |
| @@ -186,7 +187,7 @@ namespace, in addition to essential bind-mounts such /proc." | |||
| 186 | (when log-file | 187 | (when log-file |
| 187 | ;; Create LOG-FILE so we can map it in the container. | 188 | ;; Create LOG-FILE so we can map it in the container. |
| 188 | (unless (file-exists? log-file) | 189 | (unless (file-exists? log-file) |
| 189 | (call-with-output-file log-file (const #t)) | 190 | (close (open log-file (logior O_CREAT O_APPEND O_CLOEXEC) #o640)) |
| 190 | (when user | 191 | (when user |
| 191 | (let ((pw (getpwnam user))) | 192 | (let ((pw (getpwnam user))) |
| 192 | (chown log-file (passwd:uid pw) (passwd:gid pw)))))) | 193 | (chown log-file (passwd:uid pw) (passwd:gid pw)))))) |
