Skip to content

Commit

Permalink
fix: Poor file permissions used when creating a file or using os.Chmo…
Browse files Browse the repository at this point in the history
…d GSC-G302
  • Loading branch information
ikawaha committed Jan 20, 2024
1 parent 7d428e3 commit b6d803a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cmd/lattice/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func command(_ context.Context, opt *option) error {
}
out := Stdout
if opt.output != "" {
f, err := os.OpenFile(opt.output, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o666)
f, err := os.OpenFile(opt.output, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o600)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion kagome_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func TestKagomeTokenizerGolden(t *testing.T) {
}
defer golden.Close()

dump, err := os.OpenFile(dumpText, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o666)
dump, err := os.OpenFile(dumpText, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0o600)
if err != nil {
t.Fatalf("unexpected error, %v", err)
}
Expand Down

0 comments on commit b6d803a

Please sign in to comment.