Skip to content

Commit

Permalink
Resolves issue where docker communicator mishandled symlinks by treat…
Browse files Browse the repository at this point in the history
…ing them as files
  • Loading branch information
combatpoodle committed Nov 12, 2014
1 parent ec216a5 commit d408024
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions builder/docker/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,16 @@ func (c *Communicator) UploadDir(dst string, src string, exclude []string) error
return os.MkdirAll(hostpath, info.Mode())
}

if info.Mode() & os.ModeSymlink == os.ModeSymlink {
dest, err := os.Readlink(path)

if err != nil {
return err
}

return os.Symlink(dest, hostpath)
}

// It is a file, copy it over, including mode.
src, err := os.Open(path)
if err != nil {
Expand Down

0 comments on commit d408024

Please sign in to comment.