[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: activation: Keep going when failing to create one of the setuid p
From: |
guix-commits |
Subject: |
01/03: activation: Keep going when failing to create one of the setuid programs. |
Date: |
Thu, 2 Jan 2020 13:43:07 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 7c4e4bac876190eae90635ba7d7f59892c31bcc6
Author: Ludovic Courtès <address@hidden>
Date: Thu Jan 2 18:29:00 2020 +0100
activation: Keep going when failing to create one of the setuid programs.
Fixes <https://bugs.gnu.org/38800>.
Reported by Jakub Kądziołka <address@hidden>.
* gnu/build/activation.scm (activate-setuid-programs): Catch
'system-error' around 'make-setuid-program' calls.
---
gnu/build/activation.scm | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/gnu/build/activation.scm b/gnu/build/activation.scm
index c6c7e7f..6d69628 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
<address@hidden>
+;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès
<address@hidden>
;;; Copyright © 2015 Mark H Weaver <address@hidden>
;;;
;;; 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