From 45a8341811750271fcdd44a70ec803e5019e019d Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Wed, 8 Feb 2017 15:09:06 +0800 Subject: [PATCH] Small cleanup Signed-off-by: Qiang Huang --- libcontainer/rootfs_linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/rootfs_linux.go b/libcontainer/rootfs_linux.go index 9df6f4ab..704aaa8e 100644 --- a/libcontainer/rootfs_linux.go +++ b/libcontainer/rootfs_linux.go @@ -230,7 +230,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error { // any previous mounts can invalidate the next mount's destination. // this can happen when a user specifies mounts within other mounts to cause breakouts or other // evil stuff to try to escape the container's rootfs. - if dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil { + if dest, err = symlink.FollowSymlinkInScope(dest, rootfs); err != nil { return err } if err := checkMountDestination(rootfs, dest); err != nil { @@ -318,7 +318,7 @@ func mountToRootfs(m *configs.Mount, rootfs, mountLabel string) error { // this can happen when a user specifies mounts within other mounts to cause breakouts or other // evil stuff to try to escape the container's rootfs. var err error - if dest, err = symlink.FollowSymlinkInScope(filepath.Join(rootfs, m.Destination), rootfs); err != nil { + if dest, err = symlink.FollowSymlinkInScope(dest, rootfs); err != nil { return err } if err := checkMountDestination(rootfs, dest); err != nil {