]> git.ipfire.org Git - thirdparty/lxc.git/commit
conf: fix tty creation
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 5 Sep 2017 10:41:30 +0000 (12:41 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 24 Sep 2017 04:32:31 +0000 (00:32 -0400)
commit6f7cf1705e1637ec0f439d6b9882a02d2e71af14
tree6c9c55376e5d2d50f8d33ca8d8c2c29f5f589853
parent44a43f52b4297d5b20f3f83f9119d87ee5b5efa0
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