Skip to content

Commit 60e6cf6

Browse files
committed
fix: Golang security checks by gosec #301
1 parent f118839 commit 60e6cf6

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

internal/updater/updater.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func UpdateConfInDir(rootDir string, outputDir string, indent int, indentChar st
118118
}
119119

120120
os.MkdirAll(filepath.Dir(output), 0700)
121-
err = os.WriteFile(output, []byte(DecodeEscapeChars(modifiedData)), 0644)
121+
err = os.WriteFile(output, []byte(DecodeEscapeChars(modifiedData)), 0600)
122122
if err != nil {
123123
fmt.Printf("Formatter Nginx Conf %s failed, can not save the file\n", output)
124124
return err

main.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func InitArgv() {
5252
fmt.Println("No output directory specified, use the current working directory:", dir)
5353
FORMATTER_DEST = dir
5454
} else {
55-
err := os.MkdirAll(outputDir, 0755)
55+
err := os.MkdirAll(outputDir, 0750)
5656
if err != nil {
5757
fmt.Println(err)
5858
os.Exit(1)

0 commit comments

Comments
 (0)