Merge pull request #11148 from ahmetalpbalkan/win-cli/chmod-x-fix

pkg/archive: adjust chmod bits on windows
This commit is contained in:
Tibor Vass 2015-03-06 12:28:58 -05:00
commit 0a46fb04bc
5 changed files with 58 additions and 0 deletions

View file

@ -25,6 +25,17 @@ func CanonicalTarNameForPath(p string) (string, error) {
}
// chmodTarEntry is used to adjust the file permissions used in tar header based
// on the platform the archival is done.
func chmodTarEntry(perm os.FileMode) os.FileMode {
// Clear r/w on grp/others: no precise equivalen of group/others on NTFS.
perm &= 0711
// Add the x bit: make everything +x from windows
perm |= 0100
return perm
}
func setHeaderForSpecialDevice(hdr *tar.Header, ta *tarAppender, name string, stat interface{}) (nlink uint32, inode uint64, err error) {
// do nothing. no notion of Rdev, Inode, Nlink in stat on Windows
return