Skip to content

Commit

Permalink
Fix /dev/ptmx in sandboxes
Browse files Browse the repository at this point in the history
This was broken since ff0c0b6. Since
I can't figure out how to mount a devpts instance in the sandbox,
let's just bind-mount the host devpts.
  • Loading branch information
edolstra committed Oct 14, 2016
1 parent 2f9d60e commit ae8884b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/libstore/build.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2300,6 +2300,8 @@ void DerivationGoal::runChild()
ss.push_back("/dev/tty");
ss.push_back("/dev/urandom");
ss.push_back("/dev/zero");
ss.push_back("/dev/ptmx");
ss.push_back("/dev/pts");
createSymlink("/proc/self/fd", chrootRootDir + "/dev/fd");
createSymlink("/proc/self/fd/0", chrootRootDir + "/dev/stdin");
createSymlink("/proc/self/fd/1", chrootRootDir + "/dev/stdout");
Expand Down Expand Up @@ -2350,11 +2352,14 @@ void DerivationGoal::runChild()
fmt("size=%s", settings.get("sandbox-dev-shm-size", std::string("50%"))).c_str()) == -1)
throw SysError("mounting /dev/shm");

#if 0
// FIXME: can't figure out how to do this in a user
// namespace.

/* Mount a new devpts on /dev/pts. Note that this
requires the kernel to be compiled with
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y (which is the case
if /dev/ptx/ptmx exists). */
#if 0
if (pathExists("/dev/pts/ptmx") &&
!pathExists(chrootRootDir + "/dev/ptmx")
&& dirsInChroot.find("/dev/pts") == dirsInChroot.end())
Expand Down

0 comments on commit ae8884b

Please sign in to comment.