mirror of
https://github.com/golang/go
synced 2024-11-11 23:40:22 -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:
parent
214a1ca3c5
commit
b3ca3e9564
7
misc/dist/bindist.go
vendored
7
misc/dist/bindist.go
vendored
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user