From 1d1678579977851976543585104c269bda5ce719 Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 14 Feb 2014 23:23:24 +0100 Subject: [PATCH] lxc-start: close inherited fds right before exec MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Not before we've even forked. Signed-off-by: Serge Hallyn Acked-by: Stéphane Graber --- src/lxc/start.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lxc/start.c b/src/lxc/start.c index 69e34861a..81d3f47cc 100644 --- a/src/lxc/start.c +++ b/src/lxc/start.c @@ -676,6 +676,9 @@ static int do_start(void *data) close(handler->sigfd); + if (lxc_check_inherited(handler->conf, -1)) + return -1; + /* after this call, we are in error because this * ops should not return as it execs */ handler->ops->start(handler, handler->data); @@ -1030,9 +1033,6 @@ int lxc_start(const char *name, char *const argv[], struct lxc_conf *conf, .argv = argv, }; - if (lxc_check_inherited(conf, -1)) - return -1; - conf->need_utmp_watch = 1; return __lxc_start(name, conf, &start_ops, &start_arg, lxcpath); } -- 2.39.5