diff --git a/src/lxc/lxc_init.c b/src/lxc/lxc_init.c index 05b429735..b0b7ac7c9 100644 --- a/src/lxc/lxc_init.c +++ b/src/lxc/lxc_init.c @@ -92,6 +92,10 @@ int main(int argc, char *argv[]) exit(err); } + /* no need of other inherited fds but stderr */ + close(fileno(stdin)); + close(fileno(stdout)); + err = 0; for (;;) { int status; diff --git a/src/lxc/start.c b/src/lxc/start.c index 3b5023c9f..7d5763a75 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -547,6 +547,10 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf) goto out_fini; } + /* no need of other inherited fds but stderr */ + close(fileno(stdin)); + close(fileno(stdout)); + err = lxc_poll(name, handler); if (err) { ERROR("mainloop exited with an error");