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:
Harold Dost 2020-08-12 23:23:17 +02:00 committed by GitHub
parent 64236cf9e8
commit 21a753c4e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 6 additions and 6 deletions

View file

@ -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

View file

@ -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
} }

View file

@ -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
} }

View file

@ -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
} }

View file

@ -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
} }

View file

@ -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)