Save files in local storage as group readable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Go creates temporary files as 600 (334a591a3f/src/os/tempfile.go (L44)), but sometimes we want the group to be able to read them (for example, for another user to back up the storage.)
This commit is contained in:
Cat /dev/Nulo 2022-09-17 18:07:42 -03:00
parent ad123522d5
commit 70470a77f7

View file

@ -102,6 +102,9 @@ func (l *LocalStorage) Save(path string, r io.Reader, size int64) (int64, error)
if err := util.Rename(tmp.Name(), p); err != nil {
return 0, err
}
if err := os.Chmod(p, 0640); err != nil {
return 0, err
}
tmpRemoved = true