mirror of
https://github.com/golang/go
synced 2024-11-25 08:37:57 -07:00
misc/dist: don't lose mode bits when setting tar permissions
R=golang-dev, bsiegert, rsc CC=golang-dev https://golang.org/cl/5822046
This commit is contained in:
parent
5c8e88d6d2
commit
d6ea81e0b9
8
misc/dist/bindist.go
vendored
8
misc/dist/bindist.go
vendored
@ -546,11 +546,11 @@ func makeTar(targ, workdir string) error {
|
|||||||
hdr.Uid = 0
|
hdr.Uid = 0
|
||||||
hdr.Gid = 0
|
hdr.Gid = 0
|
||||||
|
|
||||||
// Force mode to 0755 for executables, 0644 for everything else.
|
// Force permissions to 0755 for executables, 0644 for everything else.
|
||||||
if hdr.Mode&0111 != 0 {
|
if fi.Mode().Perm()&0111 != 0 {
|
||||||
hdr.Mode = 0755
|
hdr.Mode = hdr.Mode&^0777 | 0755
|
||||||
} else {
|
} else {
|
||||||
hdr.Mode = 0644
|
hdr.Mode = hdr.Mode&^0777 | 0644
|
||||||
}
|
}
|
||||||
|
|
||||||
err = tw.WriteHeader(hdr)
|
err = tw.WriteHeader(hdr)
|
||||||
|
Loading…
Reference in New Issue
Block a user