From 6ce91aafa8cf10985ad48b1f3aa445abd6b72866 Mon Sep 17 00:00:00 2001 From: Ilya Dmitrichenko Date: Tue, 31 Mar 2015 16:16:59 +0100 Subject: [PATCH] Check if `/proc//ns/net` is a symlink (fix #470) --- weave | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weave b/weave index ed903cee..6cdc0550 100755 --- a/weave +++ b/weave @@ -289,7 +289,7 @@ with_container_netns () { } connect_container_to_bridge() { - if [ "$(readlink $PROCFS/$CONTAINER_PID/ns/net)" = "$(readlink $PROCFS/$$/ns/net)" ] ; then + if [ -h "$PROCFS/$CONTAINER_PID/ns/net" -a -h "$PROCFS/$$/ns/net" -a "$(readlink $PROCFS/$CONTAINER_PID/ns/net)" = "$(readlink $PROCFS/$$/ns/net)" ] ; then echo "Container is running in the host network namespace, and therefore cannot be" >&2 echo "connected to weave. Perhaps the container was started with --net=host." >&2 return 1