system: Accept gexps in 'setuid-programs'.

Commit a7ac19851b led configs such as the
following one, which were previously valid, to be rejected:

  (operating-system
    ;; ...
    (setuid-programs (cons #~(string-append #$wireshark "/bin/dumpcap")
                           %setuid-programs)))

They are now accepted again.

Reported by wonko on #guix.

* gnu/system.scm (%ensure-setuid-program-list): Handle the case where
PROGRAM is not a file-like.
This commit is contained in:
Ludovic Courtès 2021-08-12 12:08:55 +02:00
parent e0bd47b4fd
commit 2826f488e4
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -1082,11 +1082,13 @@ (define (warn-once)
(set! warned? #t)))
(map (match-lambda
((? file-like? program)
(warn-once)
(setuid-program (program program)))
((? setuid-program? program)
program))
program)
(program
;; PROGRAM is a file-like or a gexp like #~(string-append #$foo
;; "/bin/bar").
(warn-once)
(setuid-program (program program))))
lst))
(define %setuid-programs