diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-08-26 15:30:04 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-08-26 15:30:04 +0200 |
commit | ef5ddb0e1715328713c2c9edad897f9a27de692f (patch) | |
tree | b7de15179733f5c34f4b4024957a4b1768601e42 /gnu/services/mcron.scm | |
parent | ce022b2e142c75b9e4d05fc1aec91e345dc374a7 (diff) | |
download | guix-ef5ddb0e1715328713c2c9edad897f9a27de692f.tar guix-ef5ddb0e1715328713c2c9edad897f9a27de692f.tar.gz |
services: mcron: Validate jobs even in the presence of #:user.
Fixes a bug in 949672c923b6a3953471c446e0b19f30be335572 whereby jobs
specifying a #:user not available in the build environment would fail
validation.
Reported by Maxim Cournoyer.
* gnu/services/mcron.scm (job-files)[validated-file]: Add "prologue"
file and pass it to 'mcron --schedule'.
Diffstat (limited to 'gnu/services/mcron.scm')
-rw-r--r-- | gnu/services/mcron.scm | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gnu/services/mcron.scm b/gnu/services/mcron.scm index 045d6e2fe8..bd4e6e7410 100644 --- a/gnu/services/mcron.scm +++ b/gnu/services/mcron.scm @@ -67,12 +67,21 @@ #~(begin (use-modules (guix build utils)) + (call-with-output-file "prologue" + (lambda (port) + ;; This prologue allows 'mcron --schedule' to + ;; proceed no matter what #:user option is passed + ;; to 'job'. + (write '(set! getpw + (const (getpwuid (getuid)))) + port))) + (call-with-output-file "job" (lambda (port) (write '#$job port))) (invoke #+(file-append mcron "/bin/mcron") - "--schedule=20" "job") + "--schedule=20" "prologue" "job") (copy-file "job" #$output))) #:options '(#:env-vars (("COLUMNS" . "150"))))) |