Windows: Fix absolute checks

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2015-08-26 16:39:16 -07:00
parent 65841492f0
commit f012ac7b5a
2 changed files with 5 additions and 2 deletions

View file

@ -10,6 +10,7 @@ import (
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/system"
)
// Errors used or returned by this file.
@ -210,7 +211,7 @@ func CopyInfoDestinationPath(path string) (info CopyInfo, err error) {
return CopyInfo{}, err
}
if !filepath.IsAbs(linkTarget) {
if !system.IsAbs(linkTarget) {
// Join with the parent directory.
dstParent, _ := SplitPathDirEntry(path)
linkTarget = filepath.Join(dstParent, linkTarget)

View file

@ -12,6 +12,8 @@ import (
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/system"
)
// FollowSymlinkInScope is a wrapper around evalSymlinksInScope that returns an
@ -120,7 +122,7 @@ func evalSymlinksInScope(path, root string) (string, error) {
if err != nil {
return "", err
}
if filepath.IsAbs(dest) {
if system.IsAbs(dest) {
b.Reset()
}
path = dest + string(filepath.Separator) + path