about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-04-02T21·41+0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-03T11·42+0200
commite7720aa10a1da63bb15a4587837d649268944943 (patch)
tree587dde08fbbd0d12e15adbd43df215e6be6b13d5 /src
parentac6ceea7641d6c19c71079e22b03b4c1519c0c94 (diff)
Make sure /dev/pts/ptmx is world-writable
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.
Diffstat (limited to 'src')
-rw-r--r--src/libstore/build.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index b3d2796d813c..2e2f92fadf39 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2086,6 +2086,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