mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-07-13 03:45:30 +00:00
lxc-start: close inherited fds right before exec
Not before we've even forked. Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com> Acked-by: Stéphane Graber <stgraber@ubuntu.com>
This commit is contained in:
parent
93c379f09c
commit
1d16785799
@ -676,6 +676,9 @@ static int do_start(void *data)
|
|||||||
|
|
||||||
close(handler->sigfd);
|
close(handler->sigfd);
|
||||||
|
|
||||||
|
if (lxc_check_inherited(handler->conf, -1))
|
||||||
|
return -1;
|
||||||
|
|
||||||
/* after this call, we are in error because this
|
/* after this call, we are in error because this
|
||||||
* ops should not return as it execs */
|
* ops should not return as it execs */
|
||||||
handler->ops->start(handler, handler->data);
|
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,
|
.argv = argv,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (lxc_check_inherited(conf, -1))
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
conf->need_utmp_watch = 1;
|
conf->need_utmp_watch = 1;
|
||||||
return __lxc_start(name, conf, &start_ops, &start_arg, lxcpath);
|
return __lxc_start(name, conf, &start_ops, &start_arg, lxcpath);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user