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 <vincent.giersch@ovh.net>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
Vincent Giersch 2014-05-23 11:04:26 +02:00 committed by Stéphane Graber
parent a90842e41e
commit 9581b4b739

View File

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