Skip to content

Commit

Permalink
Treat unix sockets as regular files
Browse files Browse the repository at this point in the history
This fix is similar to the fix in moby#1144; but was hit in a different code
path.

Signed-off-by: Alex Couture-Beil <[email protected]>
  • Loading branch information
alexcb committed Jul 23, 2020
1 parent ed029cf commit 66c656a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cache/contenthash/filehash.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ func NewFileHash(path string, fi os.FileInfo) (hash.Hash, error) {
stat.Mode = stat.Mode | 0777
}

// Clear the socket bit since archive/tar.FileInfoHeader does not handle it
stat.Mode &^= uint32(os.ModeSocket)

if err := setUnixOpt(path, fi, stat); err != nil {
return nil, err
}
Expand Down

0 comments on commit 66c656a

Please sign in to comment.