summary refs log tree commit diff
path: root/gnu/build
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-01-02 18:29:00 +0100
committerLudovic Courtès <ludo@gnu.org>2020-01-02 19:42:59 +0100
commit7c4e4bac876190eae90635ba7d7f59892c31bcc6 (patch)
tree00fc08f359a9ac2277ded4d2232d62b3579076a6 /gnu/build
parent2d41d861bfeba18a271305a016b06a11a02c1d5a (diff)
downloadguix-7c4e4bac876190eae90635ba7d7f59892c31bcc6.tar.gz
activation: Keep going when failing to create one of the setuid programs.
Fixes <https://bugs.gnu.org/38800>.
Reported by Jakub Kądziołka <kuba@kadziolka.net>.

* gnu/build/activation.scm (activate-setuid-programs): Catch
'system-error' around 'make-setuid-program' calls.
Diffstat (limited to 'gnu/build')
-rw-r--r--gnu/build/activation.scm16
1 files changed, 14 insertions, 2 deletions
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index c6c7e7fd3b..6d69628eb2 100644
--- a/gnu/build/activation.scm
+++ b/gnu/build/activation.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès <ludo@gnu.org>
 ;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -247,7 +247,19 @@ they already exist."
                          string<?))
       (mkdir-p %setuid-directory))
 
-  (for-each make-setuid-program programs))
+  (for-each (lambda (program)
+              (catch 'system-error
+                (lambda ()
+                  (make-setuid-program program))
+                (lambda args
+                  ;; If we fail to create a setuid program, better keep going
+                  ;; so that we don't leave %SETUID-DIRECTORY empty or
+                  ;; half-populated.  This can happen if PROGRAMS contains
+                  ;; incorrect file names: <https://bugs.gnu.org/38800>.
+                  (format (current-error-port)
+                          "warning: failed to make '~a' setuid-root: ~a~%"
+                          program (strerror (system-error-errno args))))))
+            programs))
 
 (define (activate-special-files special-files)
   "Install the files listed in SPECIAL-FILES.  Each element of SPECIAL-FILES