guix-devel
[Top][All Lists]
Advanced

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

[PATCH] Make sure /dev/pts/ptmx is world-writable


From: Ludovic Courtès
Subject: [PATCH] Make sure /dev/pts/ptmx is world-writable
Date: Wed, 02 Apr 2014 23:41:11 +0200
User-agent: Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux)

Hello,

While running Python 3’s test suite, we noticed that on some systems
/dev/pts/ptmx is created with permissions 0 (that’s the case with my
Nixpkgs-originating 3.0.43 kernel, but someone with a Debian-originating
3.10-3 reported not having this problem.)

There’s still the problem that people without
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y are screwed (as noted in build.cc),
but I don’t see how we could work around it.

Thoughts?

Ludo’.

diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e846995..53a92c1 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2079,6 +2079,10 @@ void DerivationGoal::initChild()
                 if (mount("none", (chrootRootDir + "/dev/pts").c_str(), 
"devpts", 0, "newinstance,mode=0620") == -1)
                     throw SysError("mounting /dev/pts");
                 createSymlink("/dev/pts/ptmx", chrootRootDir + "/dev/ptmx");
+
+               /* Make sure /dev/pts/ptmx is world-writable.  With some
+                  Linux versions, it is created with permissions 0.  */
+               chmod_(chrootRootDir + "/dev/pts/ptmx", 0666);
             }
 
             /* Do the chroot().  Below we do a chdir() to the

reply via email to

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