Skip to content

Commit

Permalink
start: don't close inherited namespace fds
Browse files Browse the repository at this point in the history
Otherwise we can never share namespaces.

Signed-off-by: LiFeng <lifeng68@huawei.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
lifeng68 authored and stgraber committed Oct 4, 2017
1 parent 9bd0222 commit b1eee4e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lxc/start.c
Expand Up @@ -236,6 +236,15 @@ int lxc_check_inherited(struct lxc_conf *conf, bool closeall,
(i < len_fds && fd == fds_to_ignore[i]))
continue;

if (conf) {
for (i = 0; i < LXC_NS_MAX; i++)
if (conf->inherit_ns_fd[i] == fd)
break;

if (i < LXC_NS_MAX)
continue;
}

if (current_config && fd == current_config->logfd)
continue;

Expand Down

0 comments on commit b1eee4e

Please sign in to comment.