From: Vincent Giersch Date: Fri, 23 May 2014 09:04:26 +0000 (+0200) Subject: Fix a file descriptor leak in the daemonization X-Git-Tag: lxc-1.0.6~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=427b9615c064dc7f8d5ccf7250c60b872e29817f;p=thirdparty%2Flxc.git Fix a file descriptor leak in the daemonization Especially when using the Python API, the child process inherits of the file descriptiors of the script. Signed-off-by: Vincent Giersch Acked-by: Stéphane Graber --- diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 9be1ce1f3..51666141c 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -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);