From 48907d57ede696c68e210cb93cb405124a49cbd3 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Wed, 28 May 2014 16:12:29 -0700 Subject: [PATCH] fix bug in getRootResourcePath in previous commit Docker-DCO-1.1-Signed-off-by: Tibor Vass (github: tiborvass) --- daemon/container.go | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/daemon/container.go b/daemon/container.go index 09806cffad..2fd827eb9c 100644 --- a/daemon/container.go +++ b/daemon/container.go @@ -163,26 +163,12 @@ func (container *Container) WriteHostConfig() error { func (container *Container) getResourcePath(path string) (string, error) { cleanPath := filepath.Join("/", path) - fullPath := filepath.Join(container.basefs, cleanPath) - - result, err := symlink.FollowSymlinkInScope(fullPath, container.basefs) - if err != nil { - return "", err - } - - return result, nil + return symlink.FollowSymlinkInScope(filepath.Join(container.basefs, cleanPath), container.basefs) } func (container *Container) getRootResourcePath(path string) (string, error) { cleanPath := filepath.Join("/", path) - fullPath := filepath.Join(container.root, cleanPath) - - result, err := symlink.FollowSymlinkInScope(fullPath, container.basefs) - if err != nil { - return "", err - } - - return result, nil + return symlink.FollowSymlinkInScope(filepath.Join(container.root, cleanPath), container.root) } func populateCommand(c *Container, env []string) error {