]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/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)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 9 Jul 2013 10:05:14 +0000 (11:05 +0100)
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>
src/lxc/lxc_controller.c

index 88601f12b52c7271e0d8b858cc9ee61465c7119e..568227f177abcb29a45baa250c3456ace023559a 100644 (file)
@@ -1286,6 +1286,7 @@ static int virLXCControllerPopulateDevices(virLXCControllerPtr ctrl)
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_FULL, 0666, "/full" },
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_RANDOM, 0666, "/random" },
         { LXC_DEV_MAJ_MEMORY, LXC_DEV_MIN_URANDOM, 0666, "/urandom" },
+        { LXC_DEV_MAJ_TTY, LXC_DEV_MIN_TTY, 0666, "/tty" },
     };
 
     if (virLXCControllerSetupDev(ctrl) < 0)