1
0

Add gosec static analysis

This commit is contained in:
kolaente
2020-04-13 22:30:09 +02:00
parent fb8ac92abf
commit b8d7c97eb7
8 changed files with 16 additions and 9 deletions

View File

@ -86,7 +86,7 @@ func GetLogWriter(logfile string) (writer io.Writer) {
switch viper.GetString("log." + logfile) {
case "file":
fullLogFilePath := config.LogPath.GetString() + "/" + logfile + ".log"
f, err := os.OpenFile(fullLogFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
f, err := os.OpenFile(fullLogFilePath, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0600)
if err != nil {
Fatalf("Could not create logfile %s: %s", fullLogFilePath, err.Error())
}