aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2016-01-23 18:40:33 -0500
committerMark H Weaver <mhw@netris.org>2016-01-23 18:44:03 -0500
commitc5184468f5ee9d41ac5a49126d9017b635c80288 (patch)
treef01bf706c99a6d6f47c0d9d70d7318c86c46db3d /gnu
parentfe17fb4a2c897fd9186f91887f5af63dd00d227a (diff)
downloadguix-c5184468f5ee9d41ac5a49126d9017b635c80288.tar
guix-c5184468f5ee9d41ac5a49126d9017b635c80288.tar.gz
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.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/build/linux-container.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index eb5dbf94a3..ec68679f0b 100644
--- a/gnu/build/linux-container.scm
+++ b/gnu/build/linux-container.scm
@@ -41,7 +41,7 @@
"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?)