]> git.ipfire.org Git - thirdparty/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:58:05 +0000 (18:58 -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 eedbae50cd525d77a131f6f11d1dde9ebcabf18e..73bb82a3d1802a64f952a913dc88441a1f1c5013 100644 (file)
@@ -229,6 +229,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;