Merge pull request #11148 from ahmetalpbalkan/win-cli/chmod-x-fix
pkg/archive: adjust chmod bits on windows
This commit is contained in:
commit
0a46fb04bc
5 changed files with 58 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue