mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Make file permissions set to allow for wider umask options. (#7782)
0644 -> 0666 on all non vendored code. Fixes #7717 Signed-off-by: Harold Dost <harolddost@gmail.com>
This commit is contained in:
parent
64236cf9e8
commit
21a753c4e2
|
@ -21,7 +21,7 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
const filePerm = 0644
|
||||
const filePerm = 0666
|
||||
|
||||
type tarGzFileWriter struct {
|
||||
tarWriter *tar.Writer
|
||||
|
|
|
@ -65,7 +65,7 @@ func copyFile(src, dest string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
err = ioutil.WriteFile(dest, data, 0644)
|
||||
err = ioutil.WriteFile(dest, data, 0666)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ func (l *plan9Lock) Release() error {
|
|||
}
|
||||
|
||||
func newLock(fileName string) (Releaser, error) {
|
||||
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, os.ModeExclusive|0644)
|
||||
f, err := os.OpenFile(path, os.O_RDWR|os.O_CREATE, os.ModeExclusive|0666)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ func (l *unixLock) set(lock bool) error {
|
|||
}
|
||||
|
||||
func newLock(fileName string) (Releaser, error) {
|
||||
f, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0644)
|
||||
f, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ func (l *unixLock) set(lock bool) error {
|
|||
}
|
||||
|
||||
func newLock(fileName string) (Releaser, error) {
|
||||
f, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0644)
|
||||
f, err := os.OpenFile(fileName, os.O_RDWR|os.O_CREATE, 0666)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
@ -502,7 +502,7 @@ func TestNewFileReaderErrorNoOpenFiles(t *testing.T) {
|
|||
dir := testutil.NewTemporaryDirectory("block", t)
|
||||
|
||||
idxName := filepath.Join(dir.Path(), "index")
|
||||
err := ioutil.WriteFile(idxName, []byte("corrupted contents"), 0644)
|
||||
err := ioutil.WriteFile(idxName, []byte("corrupted contents"), 0666)
|
||||
testutil.Ok(t, err)
|
||||
|
||||
_, err = NewFileReader(idxName)
|
||||
|
|
Loading…
Reference in a new issue