mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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
1 changed files with 1 additions and 1 deletions
|
@ -41,7 +41,7 @@ (define (unprivileged-user-namespace-supported?)
|
|||
"Return #t if user namespaces can be created by unprivileged users."
|
||||
(let ((userns-file "/proc/sys/kernel/unprivileged_userns_clone"))
|
||||
(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)))
|
||||
|
||||
(define (setgroups-supported?)
|
||||
|
|
Loading…
Reference in a new issue