Skip to content
Myr

chore: restrict logfile permissions to owner-only

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Christian Rocha · committed by Christian Rocha · parent c284aca · Browse files · 1 file+1 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−1 removed

  • other:+1 added−1 removed

1 file+1 added−1 removed

modified:logging.go+1 added-1 removed
31 unmodified lines
32}3334// LogToFileWith does allows to call LogToFile with a custom LogOptionsSetter.35func LogToFileWith(path string, prefix string, log LogOptionsSetter) (*os.File, error) {36 f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o644) //nolint:gomnd36 f, err := os.OpenFile(path, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0o600) //nolint:gomnd37 if err != nil {38 return nil, fmt.Errorf("error opening file for logging: %w", err)39 }40 log.SetOutput(f)
13 unmodified lines