mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
gosec: Fix violations of G301 (#14980)
* gosec: Fix violations of G301 * Changelog fragment
This commit is contained in:
@@ -20,7 +20,7 @@ func tempDir() string {
|
||||
func UseOsMkdirAllAndWriteFile() {
|
||||
randPath, _ := rand.Int(rand.Reader, big.NewInt(1000000))
|
||||
p := filepath.Join(tempDir(), fmt.Sprintf("/%d", randPath))
|
||||
_ = os.MkdirAll(p, os.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
_ = os.MkdirAll(p, 0750) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
someFile := filepath.Join(p, "some.txt")
|
||||
_ = os.WriteFile(someFile, []byte("hello"), os.ModePerm) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
_ = os.WriteFile(someFile, []byte("hello"), 0600) // want "os and ioutil dir and file writing functions are not permissions-safe, use shared/file"
|
||||
}
|
||||
|
||||
@@ -78,5 +78,5 @@ func getAndSaveFile(specDocUrl, outFilePath string) error {
|
||||
}
|
||||
|
||||
func prepareDir(dirPath string) error {
|
||||
return os.MkdirAll(dirPath, os.ModePerm)
|
||||
return os.MkdirAll(dirPath, 0750)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user