From 534d5489043e53b28c6d6ad926ce1aac9134b09f Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: Thu, 23 Nov 2023 16:29:49 +0000 Subject: [PATCH] fix: log file permissions 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 --- logger/logger.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logger/logger.go b/logger/logger.go index 3368560..3bfb97c 100644 --- a/logger/logger.go +++ b/logger/logger.go @@ -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