Reduce cache directory permissions. (#788)

Fixes #782
This commit is contained in:
Trevor Pounds 2019-10-06 12:21:43 -04:00 committed by Isaev Denis
parent a7a60390b1
commit 8e0197ec9c
3 changed files with 3 additions and 3 deletions

View File

@ -61,7 +61,7 @@ func Open(dir string) (*Cache, error) {
}
for i := 0; i < 256; i++ {
name := filepath.Join(dir, fmt.Sprintf("%02x", i))
if err := os.MkdirAll(name, 0777); err != nil {
if err := os.MkdirAll(name, 0744); err != nil {
return nil, err
}
}

View File

@ -31,7 +31,7 @@ func TestBasic(t *testing.T) {
}
cdir := filepath.Join(dir, "c1")
if err := os.Mkdir(cdir, 0777); err != nil {
if err := os.Mkdir(cdir, 0744); err != nil {
t.Fatal(err)
}

View File

@ -34,7 +34,7 @@ const cacheREADME = `This directory holds cached build artifacts from golangci-l
// the first time Default is called.
func initDefaultCache() {
dir := DefaultDir()
if err := os.MkdirAll(dir, 0777); err != nil {
if err := os.MkdirAll(dir, 0744); err != nil {
log.Fatalf("failed to initialize build cache at %s: %s\n", dir, err)
}
if _, err := os.Stat(filepath.Join(dir, "README")); err != nil {