-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
- Version of golangci-lint:
golangci-lint --version: currentHEAD:fd997edeeb4ac277823750d746394d80f03d7ec1 - Config file:
cat .golangci.yml: N/A - Go environment:
go version && go env: N/A - Verbose output of running:
golangci-lint run -v: N/A
While reading golangci-lint source code I found that the cache initialization method creates the directory using too many permissions:
golangci-lint/internal/cache/default.go
Lines 33 to 50 in 6a979fb
| // initDefaultCache does the work of finding the default cache | |
| // the first time Default is called. | |
| func initDefaultCache() { | |
| dir := DefaultDir() | |
| if err := os.MkdirAll(dir, 0777); 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 { | |
| // Best effort. | |
| ioutil.WriteFile(filepath.Join(dir, "README"), []byte(cacheREADME), 0666) | |
| } | |
| c, err := Open(dir) | |
| if err != nil { | |
| log.Fatalf("failed to initialize build cache at %s: %s\n", dir, err) | |
| } | |
| defaultCache = c | |
| } |
Are world executable and world-writable really needed? If not, I'd be open to creating a PR.
Thanks!