1
0
mirror of https://github.com/golang/go synced 2024-11-25 04:07:55 -07:00

misc/dist: force modes to 0755 or 0644 in tarballs

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5823045
This commit is contained in:
Andrew Gerrand 2012-03-14 17:09:15 +11:00
parent 214a1ca3c5
commit b3ca3e9564

View File

@ -536,6 +536,13 @@ func makeTar(targ, workdir string) error {
hdr.Uid = 0
hdr.Gid = 0
// Force mode to 0755 for executables, 0644 for everything else.
if hdr.Mode&0111 != 0 {
hdr.Mode = 0755
} else {
hdr.Mode = 0644
}
err = tw.WriteHeader(hdr)
if err != nil {
return fmt.Errorf("Error writing file %q: %v", name, err)