build: container: Make 'unprivileged-user-namespace-supported?' more robust.
* gnu/build/linux-container.scm (unprivileged-user-namespace-supported?): Only read and check the first character, to cope with a possible newline in the (pseudo-)file.
This commit is contained in:
parent
fe17fb4a2c
commit
c5184468f5
|
@ -41,7 +41,7 @@
|
||||||
"Return #t if user namespaces can be created by unprivileged users."
|
"Return #t if user namespaces can be created by unprivileged users."
|
||||||
(let ((userns-file "/proc/sys/kernel/unprivileged_userns_clone"))
|
(let ((userns-file "/proc/sys/kernel/unprivileged_userns_clone"))
|
||||||
(if (file-exists? userns-file)
|
(if (file-exists? userns-file)
|
||||||
(string=? "1" (call-with-input-file userns-file read-string))
|
(eqv? #\1 (call-with-input-file userns-file read-char))
|
||||||
#t)))
|
#t)))
|
||||||
|
|
||||||
(define (setgroups-supported?)
|
(define (setgroups-supported?)
|
||||||
|
|
Loading…
Reference in New Issue