linux-container: Correct test for unprivileged user namespace support.

Fixes <https://bugs.gnu.org/31977>.
Reported by Paul Garlick <pgarlick@tourbillion-technology.com>.

* gnu/build/linux-container.scm (unprivileged-user-namespace-supported?):
Return #f when the 'userns-file' does not exist.
This commit is contained in:
Paul Garlick 2020-12-03 16:00:18 +00:00
parent 0d5d1bdf91
commit 8bc5ca5160
No known key found for this signature in database
GPG key ID: AAC7E891896B568A

View file

@ -44,7 +44,7 @@ (define (unprivileged-user-namespace-supported?)
(let ((userns-file "/proc/sys/kernel/unprivileged_userns_clone"))
(if (file-exists? userns-file)
(eqv? #\1 (call-with-input-file userns-file read-char))
#t)))
#f)))
(define (setgroups-supported?)
"Return #t if the setgroups proc file, introduced in Linux-libre 3.19,