]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
LXC: Create /dev/tty within a container
authorRichard Weinberger <richard@nod.at>
Tue, 9 Jul 2013 10:05:14 +0000 (11:05 +0100)
committerCole Robinson <crobinso@redhat.com>
Thu, 11 Jul 2013 21:38:47 +0000 (17:38 -0400)
Many applications use /dev/tty to read from stdin.
e.g. zypper on openSUSE.

Let's create this device node to unbreak those applications.
As /dev/tty is a synonym for the current controlling terminal
it cannot harm the host or any other containers.

Signed-off-by: Richard Weinberger <richard@nod.at>
(cherry picked from commit 9a0ac6d9c21b914f887d2a1e0051b5beffa81bd7)

Conflicts:
src/lxc/lxc_controller.c

src/lxc/lxc_container.c

index c9c11e8575f9c039d4074a189d5b125f8aba0f91..fc5327b6c26bd8105e02e69efde8c99340173926 100644 (file)
@@ -839,6 +839,7 @@ static int lxcContainerPopulateDevices(char **ttyPaths, size_t nttyPaths)
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_FULL, 0666, "/dev/full" },
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_RANDOM, 0666, "/dev/random" },
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_URANDOM, 0666, "/dev/urandom" },
+        { LXC_DEV_MAJ_TTY, LXC_DEV_MIN_TTY, 0666, "/tty" },
     };
     const struct {
         const char *src;