Commit d6ea81e0 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

misc/dist: don't lose mode bits when setting tar permissions

R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/5822046
parent 5c8e88d6
......@@ -546,11 +546,11 @@ 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
// Force permissions to 0755 for executables, 0644 for everything else.
if fi.Mode().Perm()&0111 != 0 {
hdr.Mode = hdr.Mode&^0777 | 0755
} else {
hdr.Mode = 0644
hdr.Mode = hdr.Mode&^0777 | 0644
}
err = tw.WriteHeader(hdr)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment