]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix a file descriptor leak in the daemonization
authorVincent Giersch <vincent.giersch@ovh.net>
Fri, 23 May 2014 09:04:26 +0000 (11:04 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 8 Aug 2014 16:19:26 +0000 (12:19 -0400)
Especially when using the Python API, the child process inherits of
the file descriptiors of the script.

Signed-off-by: Vincent Giersch <vincent.giersch@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
src/lxc/lxccontainer.c

index 553f026d6f4537399f40fa6dcc506f3de2e2598b..38197d606dc62de773affe67fc5b22b1977527ef 100644 (file)
@@ -625,6 +625,7 @@ static bool lxcapi_start(struct lxc_container *c, int useinit, char * const argv
                        SYSERROR("Error chdir()ing to /.");
                        return false;
                }
+               lxc_check_inherited(conf, -1);
                close(0);
                close(1);
                close(2);