]> git.proxmox.com Git - mirror_lxc.git/commit - src/lxc/terminal.c
terminal: use /dev/ptmx when allocating pty devices from devpts instances we didn...
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 17 Aug 2021 08:43:34 +0000 (10:43 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 17 Aug 2021 09:39:17 +0000 (11:39 +0200)
commit803839b8b978b29034ba7fe0ca5abe3d60dd8130
tree165a87121080f888b68d7dbbf60e51f7854daf15
parentd06abe2f9c47c2a355b3ea1a5194abe3fa8d7cb5
terminal: use /dev/ptmx when allocating pty devices from devpts instances we didn't mount ourselves

When we aren't told what devpts instance to allocate from we assume it
is the one in the caller's mount namespace.
This poses a slight complication, a lot of distros will change
permissions on /dev/ptmx so it can be opened by unprivileged users but
will not change permissions on /dev/pts/ptmx itself. In addition,
/dev/ptmx can either be a symlink, a bind-mount, or a separate device
node. So we need to allow for fairly lax lookup.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/syscall_wrappers.h
src/lxc/terminal.c