]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: close data socket in parent
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 29 Oct 2017 16:03:57 +0000 (17:03 +0100)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 16 Nov 2017 21:38:21 +0000 (16:38 -0500)
Brings the number of open fds in the monitor process for a standard container
without ttys down to 17.

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

index 664dbc3baa73e7157ef763575553bda75273b695..81cee074f791b1bfbe24c4c941e1e91e516e201f 100644 (file)
@@ -1149,6 +1149,11 @@ int __lxc_start(const char *name, struct lxc_conf *conf,
                ERROR("failed to spawn '%s'", name);
                goto out_fini_nonet;
        }
+       /* close parent side of data socket */
+       close(handler->data_sock[0]);
+       handler->data_sock[0] = -1;
+       close(handler->data_sock[1]);
+       handler->data_sock[1] = -1;
 
        handler->conf->reboot = 0;