The existing code was spuriously failing unit tests, because it was
stripping non-permission bits off the file mode.
On examination, the behaviour was inherited from similar code in
moby/moby, which was intended to affect the resulting filemodes inside
a Linux-based container built from Windows. However, this code path does
have that effect in BuildKit as we are only calculating checksums here.
Signed-off-by: Paul "TBBle" Hampson <Paul.Hampson@Pobox.com>
Use the Major/Minor functions from golang.org/x/sys/unix instead of
locally re-implementing them. This also makes sure they work correctly
for GOOS != linux.
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>