os.CreateTemp in downloadZip leaves downloaded .zip files readable only
by the owner. Make them group/world readable.
Fixes #52765
Change-Id: Iace13e4ad813201a533a1a5fc0c6d9b2e5349a42
Reviewed-on: https://go-review.googlesource.com/c/go/+/404854
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
// contents of the file (by hashing it) before we commit it. Because the file
// is zip-compressed, we need an actual file — or at least an io.ReaderAt — to
// validate it: we can't just tee the stream as we write it.
- f, err := os.CreateTemp(filepath.Dir(zipfile), tmpPattern)
+ f, err := tempFile(filepath.Dir(zipfile), filepath.Base(zipfile), 0666)
if err != nil {
return err
}