Skip to content

Commit

Permalink
fix: log file permissions
Browse files Browse the repository at this point in the history
Change created log to not be "executable" and secure by default, i.e. 755 -> 600.

This is used when `log_path` is configured.

Signed-off-by: Petr Vobornik <[email protected]>
  • Loading branch information
pvoborni committed Dec 7, 2023
1 parent 55dc8b8 commit 534d548
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func InitLogger(file string, level string, prefix string, flag int) error {

logFile := os.Stderr
if file != "" {
logFile, err = os.OpenFile(file, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0755)
logFile, err = os.OpenFile(file, os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0600)
}
if err != nil {
return err
Expand Down

0 comments on commit 534d548

Please sign in to comment.