]> 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 18:01:22 +0000 (14:01 -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 9be1ce1f39a14ff64296939117eebba583e2202b..51666141c40e7ac8a2bd8d14fe032c9d8dd03b26 100644 (file)
@@ -630,6 +630,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);