]> git.proxmox.com Git - mirror_lxc.git/commitdiff
start: don't close inherited namespace fds
authorLiFeng <lifeng68@huawei.com>
Thu, 28 Sep 2017 16:23:30 +0000 (00:23 +0800)
committerStéphane Graber <stgraber@ubuntu.com>
Wed, 4 Oct 2017 22:55:30 +0000 (18:55 -0400)
Otherwise we can never share namespaces.

Signed-off-by: LiFeng <lifeng68@huawei.com>
Acked-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 3baed693a36801c0af4e1f26143471e51453537d..33b30cb52921805cd1a869eadefe81a2cc178216 100644 (file)
@@ -236,6 +236,15 @@ restart:
                    (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;