[libvirt] [PATCH] lxc: Create /dev/tty within a container

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_container.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 181f6c8..9ab64a1 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -837,6 +837,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; -- 1.8.3

On Wed, Jun 12, 2013 at 07:46:28PM +0200, Richard Weinberger wrote:
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_container.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 181f6c8..9ab64a1 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -837,6 +837,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" },
ACK, I rebased this patch & pushed it. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
participants (2)
-
Daniel P. Berrange
-
Richard Weinberger