Merge pull request #11395 from mitchcapper/master

Change windows default permissions to 755 not 711, read access for all p...
This commit is contained in:
Jessie Frazelle 2015-03-23 09:59:40 -07:00
commit 7bddaac507
2 changed files with 7 additions and 8 deletions

View file

@ -28,10 +28,9 @@ 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
perm &= 0755
// Add the x bit: make everything +x from windows
perm |= 0100
perm |= 0111
return perm
}

View file

@ -51,11 +51,11 @@ func TestChmodTarEntry(t *testing.T) {
cases := []struct {
in, expected os.FileMode
}{
{0000, 0100},
{0777, 0711},
{0644, 0700},
{0755, 0711},
{0444, 0500},
{0000, 0111},
{0777, 0755},
{0644, 0755},
{0755, 0755},
{0444, 0555},
}
for _, v := range cases {
if out := chmodTarEntry(v.in); out != v.expected {