]> git.proxmox.com Git - mirror_lxc.git/commit
conf: fix tty creation
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Sep 2017 10:41:30 +0000 (12:41 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Sep 2017 10:41:30 +0000 (12:41 +0200)
commit2187efd31051513ef0758b6eaa336894e69039f9
tree8a3cedc7c0783f1155748642407e7943c4a6a259
parent73363c6134c61867ab304a35b233fd5b4d3bddc2
conf: fix tty creation

We allocate pty {master,slave} file descriptors in the childs namespaces after
we have setup devpts. After we have sent the pty file descriptors to the parent
and set up the pty file descriptors under /dev/tty* and before we exec the init
binary we need to delete these file descriptors in the child. However, one of
my commits made the deletion occur before setting up the file descriptors under
/dev/tty*. This caused a failures when trying to attach to the container's ttys
since they werent actually configured although the file descriptors were
available in the in-memory configuration of the parent.
This commit reworks setting up tty such that deletion occurs after all setup
has been performed. The commit is actually minimal but needs to also move all
the functions into one place since they well now be called from
"lxc_create_ttys()".

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