mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-25 05:34: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"
|
"github.com/pkg/errors"
|
||||||
)
|
)
|
||||||
|
|
||||||
const filePerm = 0644
|
const filePerm = 0666
|
||||||
|
|
||||||
type tarGzFileWriter struct {
|
type tarGzFileWriter struct {
|
||||||
tarWriter *tar.Writer
|
tarWriter *tar.Writer
|
||||||
|
|
|
@ -65,7 +65,7 @@ func copyFile(src, dest string) error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = ioutil.WriteFile(dest, data, 0644)
|
err = ioutil.WriteFile(dest, data, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,7 +24,7 @@ func (l *plan9Lock) Release() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLock(fileName string) (Releaser, 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ func (l *unixLock) set(lock bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLock(fileName string) (Releaser, 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,7 +40,7 @@ func (l *unixLock) set(lock bool) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
func newLock(fileName string) (Releaser, 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 {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -502,7 +502,7 @@ func TestNewFileReaderErrorNoOpenFiles(t *testing.T) {
|
||||||
dir := testutil.NewTemporaryDirectory("block", t)
|
dir := testutil.NewTemporaryDirectory("block", t)
|
||||||
|
|
||||||
idxName := filepath.Join(dir.Path(), "index")
|
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)
|
testutil.Ok(t, err)
|
||||||
|
|
||||||
_, err = NewFileReader(idxName)
|
_, err = NewFileReader(idxName)
|
||||||
|
|
Loading…
Reference in a new issue