1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-15 15:02:42 +01:00

build.cc: fix bind-mount of /dev/{pts,ptmx} fallback

Don't bind-mount these to themselves,
mount them into the chroot directory.

Fixes pty issues when using sandbox on CentOS 7.4.
(build of perlPackages.IOTty fails before this change)

(cherry picked from commit 6d9129014d)
This commit is contained in:
Will Dietz 2018-04-20 11:55:04 -05:00 committed by Eelco Dolstra
parent 8eceb32e0a
commit 686241825c
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -2691,8 +2691,8 @@ void DerivationGoal::runChild()
} else { } else {
if (errno != EINVAL) if (errno != EINVAL)
throw SysError("mounting /dev/pts"); throw SysError("mounting /dev/pts");
doBind("/dev/pts", "/dev/pts"); doBind("/dev/pts", chrootRootDir + "/dev/pts");
doBind("/dev/ptmx", "/dev/ptmx"); doBind("/dev/ptmx", chrootRootDir + "/dev/ptmx");
} }
} }