diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2016-10-14T13·42+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2016-10-14T13·42+0200 |
commit | ae8884b94975673e6a3338d2c5173c006b4c8d4b (patch) | |
tree | 477d1c1da00351b2a87df9bd8471ca2a3b9d9e1d /src/libstore | |
parent | 2f9d60ed7f0c05964bbe2110aeda8da6ec17bae6 (diff) |
Fix /dev/ptmx in sandboxes
This was broken since ff0c0b645cc1448959126185bb2fafe41cf0bddf. Since I can't figure out how to mount a devpts instance in the sandbox, let's just bind-mount the host devpts.
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/build.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index e7054a05a53a..1f1eb54aacc0 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -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"); @@ -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()) |