Skip to content

Commit

Permalink
preserve inherited fds for stop hook
Browse files Browse the repository at this point in the history
When preserving fds for the stop hook, make sure to also save
any fds we've inherited.

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
  • Loading branch information
hallyn authored and stgraber committed Nov 17, 2016
1 parent d06c1c9 commit f444130
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lxc/start.c
Expand Up @@ -933,7 +933,7 @@ static int lxc_spawn(struct lxc_handler *handler)
goto out_delete_net;
}

if (!preserve_ns(handler->nsfd, handler->clone_flags, handler->pid, &errmsg)) {
if (!preserve_ns(handler->nsfd, handler->clone_flags | preserve_mask, handler->pid, &errmsg)) {
INFO("Failed to store namespace references for stop hook: %s",
errmsg ? errmsg : "(Out of memory)");
free(errmsg);
Expand Down

0 comments on commit f444130

Please sign in to comment.