chore: restrict logfile permissions to owner-only

This commit is contained in:
Christian Rocha 2023-07-10 08:52:36 -04:00
parent c284acad9f
commit c4c83ba757
1 changed files with 1 additions and 1 deletions

View File

@ -33,7 +33,7 @@ type LogOptionsSetter interface {
// LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter. // LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.
func LogToFileWith(path string, prefix string, log LogOptionsSetter) (*os.File, error) { func LogToFileWith(path string, prefix string, log LogOptionsSetter) (*os.File, error) {
f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) //nolint:gomnd f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o600) //nolint:gomnd
if err != nil { if err != nil {
return nil, fmt.Errorf("error opening file for logging: %w", err) return nil, fmt.Errorf("error opening file for logging: %w", err)
} }