Skip to content

Commit

Permalink
cmd/dkim-keygen: set private key file mode to 600
Browse files Browse the repository at this point in the history
Other users shouldn't be allowed to read the file.
  • Loading branch information
emersion committed Nov 23, 2020
1 parent dc4a0d9 commit 54d908f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/dkim-keygen/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func main() {
log.Fatalf("Failed to marshal private key: %v", err)
}

f, err := os.Create(filename)
f, err := os.OpenFile(filename, os.O_RDWR|os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
log.Fatalf("Failed to create key file: %v", err)
}
Expand Down

0 comments on commit 54d908f

Please sign in to comment.