From c5184468f5ee9d41ac5a49126d9017b635c80288 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Sat, 23 Jan 2016 18:40:33 -0500 Subject: 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. --- gnu/build/linux-container.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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?) -- cgit v1.2.3