From 78f5148c67498b3356eef05d1072bccce5076eab Mon Sep 17 00:00:00 2001 From: Ido Yariv Date: Tue, 1 Mar 2016 20:59:26 -0500 Subject: [PATCH] Fix handling of unsupported namespaces currentState() always adds all possible namespaces to the state, regardless of whether they are supported. If orderNamespacePaths detects an unsupported namespace, an error is returned that results in initialization failure. Fix this by only adding paths of supported namespaces to the state. Signed-off-by: Ido Yariv --- libcontainer/container_linux.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libcontainer/container_linux.go b/libcontainer/container_linux.go index d31a34356..01781f36a 100644 --- a/libcontainer/container_linux.go +++ b/libcontainer/container_linux.go @@ -1064,6 +1064,9 @@ func (c *linuxContainer) currentState() (*State, error) { state.NamespacePaths[ns.Type] = ns.GetPath(pid) } for _, nsType := range configs.NamespaceTypes() { + if !configs.IsNamespaceSupported(nsType) { + continue + } if _, ok := state.NamespacePaths[nsType]; !ok { ns := configs.Namespace{Type: nsType} state.NamespacePaths[ns.Type] = ns.GetPath(pid)