Skip to content

Commit

Permalink
Merge pull request #314 from ikawaha/fix/GSC-G302
Browse files Browse the repository at this point in the history
fix: Poor file permissions used when creating a file or using os.Chmod GSC-G302
  • Loading branch information
ikawaha authored Jan 20, 2024
2 parents 7d428e3 + b6d803a commit 95ea912
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 95ea912

Please sign in to comment.