Merge pull request #5068 from tianon/fix-abs-volume-check

Fix edge case in bind mount absolute path detection
Upstream-commit: 1bcb9ce69e62476a8ff80d210aad85d86a72dd7b
Component: engine
This commit is contained in:
unclejack
2014-04-08 20:03:52 +03:00

View File

@ -177,12 +177,8 @@ func createVolumes(container *Container) error {
if bindMap, exists := binds[volPath]; exists {
isBindMount = true
srcPath = bindMap.SrcPath
srcAbs, err := filepath.Abs(srcPath)
if err != nil {
return err
}
if srcPath != srcAbs {
return fmt.Errorf("%s should be an absolute path", srcPath)
if !filepath.IsAbs(srcPath) {
return fmt.Errorf("%s must be an absolute path", srcPath)
}
if strings.ToLower(bindMap.Mode) == "rw" {
srcRW = true