mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #3152 from daniel-garcia/3129_dont-open-bindmounted-files
don't open bind mounted files/dirs to get Stat, use os.Lstat
This commit is contained in:
commit
4c6e528f13
1 changed files with 2 additions and 7 deletions
|
@ -801,15 +801,10 @@ func (container *Container) createVolumes() error {
|
||||||
if strings.ToLower(bindMap.Mode) == "rw" {
|
if strings.ToLower(bindMap.Mode) == "rw" {
|
||||||
srcRW = true
|
srcRW = true
|
||||||
}
|
}
|
||||||
if file, err := os.Open(bindMap.SrcPath); err != nil {
|
if stat, err := os.Lstat(bindMap.SrcPath); err != nil {
|
||||||
return err
|
return err
|
||||||
} else {
|
} else {
|
||||||
defer file.Close()
|
volIsDir = stat.IsDir()
|
||||||
if stat, err := file.Stat(); err != nil {
|
|
||||||
return err
|
|
||||||
} else {
|
|
||||||
volIsDir = stat.IsDir()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
// Otherwise create an directory in $ROOT/volumes/ and use that
|
// Otherwise create an directory in $ROOT/volumes/ and use that
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue