From bcae148da2094e44efcc9cd5dac73014ad2d413c Mon Sep 17 00:00:00 2001 From: Ahmet Alp Balkan Date: Wed, 29 Oct 2014 15:46:45 -0700 Subject: [PATCH] Fix input volume path check on Windows used path package instead of path/filepath so that --volumes and --device parameters to always validate paths as unix paths instead of OS-dependent path convention Signed-off-by: Ahmet Alp Balkan --- opts/opts.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/opts/opts.go b/opts/opts.go index 4ca7ec58ce..d3202969b4 100644 --- a/opts/opts.go +++ b/opts/opts.go @@ -5,7 +5,7 @@ import ( "net" "net/url" "os" - "path/filepath" + "path" "regexp" "strings" @@ -151,13 +151,13 @@ func ValidatePath(val string) (string, error) { splited := strings.SplitN(val, ":", 2) if len(splited) == 1 { containerPath = splited[0] - val = filepath.Clean(splited[0]) + val = path.Clean(splited[0]) } else { containerPath = splited[1] - val = fmt.Sprintf("%s:%s", splited[0], filepath.Clean(splited[1])) + val = fmt.Sprintf("%s:%s", splited[0], path.Clean(splited[1])) } - if !filepath.IsAbs(containerPath) { + if !path.IsAbs(containerPath) { return val, fmt.Errorf("%s is not an absolute path", containerPath) } return val, nil