]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
close inherited fds when we still have proc mounted
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Sat, 15 Feb 2014 18:50:31 +0000 (12:50 -0600)
committerStéphane Graber <stgraber@ubuntu.com>
Sat, 15 Feb 2014 23:37:27 +0000 (18:37 -0500)
and don't close the sigfd

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/start.c

index 60699c323e4d99968811d07e160069e30ed22f64..5b3b6eb11215f476b694a00a20005c6c64901d28 100644 (file)
@@ -650,6 +650,9 @@ static int do_start(void *data)
        if (lsm_process_label_set(lsm_label, 1, 1) < 0)
                goto out_warn_father;
 
+       if (lxc_check_inherited(handler->conf, handler->sigfd))
+               return -1;
+
        /* If we mounted a temporary proc, then unmount it now */
        tmp_proc_unmount(handler->conf);
 
@@ -678,9 +681,6 @@ 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);