guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/01: build: container: Make 'unprivileged-user-namespace-supported?' m


From: Mark H. Weaver
Subject: 01/01: build: container: Make 'unprivileged-user-namespace-supported?' more robust.
Date: Sat, 23 Jan 2016 23:44:11 +0000

mhw pushed a commit to branch master
in repository guix.

commit c5184468f5ee9d41ac5a49126d9017b635c80288
Author: Mark H Weaver <address@hidden>
Date:   Sat Jan 23 18:40:33 2016 -0500

    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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gnu/build/linux-container.scm b/gnu/build/linux-container.scm
index eb5dbf9..ec68679 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?)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]