diff options
author | Simon McVittie <smcv@debian.org> | 2017-02-20 09:22:07 (GMT) |
---|---|---|
committer | Cyril Brulebois <kibi@debian.org> | 2017-03-09 22:24:37 (GMT) |
commit | c997b80c064c6c1d36ec69da1850722f795f43e4 (patch) | |
tree | 3d443985b6c7afa584d9200769fd36092110458b /debian | |
parent | 026923842da1815c687f1db80cba472c161119d4 (diff) | |
download | debootstrap-c997b80c064c6c1d36ec69da1850722f795f43e4.zip debootstrap-c997b80c064c6c1d36ec69da1850722f795f43e4.tar.gz debootstrap-c997b80c064c6c1d36ec69da1850722f795f43e4.tar.bz2 |
Don't make /dev/ptmx a symlink to pts/ptmx if we don't have to
In a plain chroot or on real hardware, it is preferable to use mknod
to create /dev/ptmx. This works as intended with older chroot managers
such as sbuild and pbuilder, which were designed for the semantics of
"legacy" /dev/pts (a single non-virtualized pty subsystem per kernel)
and so mount /dev/pts without the newinstance option. It also works
in newer kernels where /dev/pts always behaves as though the
newinstance option was given, because on those kernels, opening a
(c,5,2) device node automatically looks for an adjacent pts directory
and uses its ptmx device node instead.
However, if we are running debootstrap inside a restricted container
such as lxc or systemd-nspawn, mknod ptmx c 5 2 might not be allowed.
If so, fall back to a symlink with a warning. This mode is fine if
the debootstrap will be used with systemd-nspawn or lxc, or if a
devtmpfs will be mounted over its /dev, but will not work for older
chroot managers like sbuild or pbuilder, because those chroot
managers leave the ptmxmode mount option at its default 000, causing
permission to open the pts/ptmx device node to be denied.
Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817236
Signed-off-by: Simon McVittie <smcv@debian.org>
Diffstat (limited to 'debian')
0 files changed, 0 insertions, 0 deletions