Save files in local storage as group readable
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
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:
parent
ad123522d5
commit
70470a77f7
1 changed files with 3 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Reference in a new issue