mirror of
https://github.com/golang/go
synced 2024-09-05 16:04:50 +00:00
cmd/dist: defend self against misc/reboot test
Change-Id: Ice89ecae980d46b16b5ed32ac733bd23c92115af Reviewed-on: https://go-review.googlesource.com/c/go/+/310870 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
parent
02a2ff47ef
commit
b65f8589e8
1
src/cmd/dist/util.go
vendored
1
src/cmd/dist/util.go
vendored
|
@ -249,6 +249,7 @@ func writefile(text, file string, flag int) {
|
|||
if flag&writeExec != 0 {
|
||||
mode = 0777
|
||||
}
|
||||
xremove(file) // in case of symlink tricks by misc/reboot test
|
||||
err := ioutil.WriteFile(file, new, mode)
|
||||
if err != nil {
|
||||
fatalf("%v", err)
|
||||
|
|
Loading…
Reference in a new issue