We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7ccc177 commit f1ed03bCopy full SHA for f1ed03b
internal/cmd/gtrace/main.go
@@ -67,11 +67,15 @@ func main() {
67
// We should respect Go suffixes like `_linux.go`.
68
name, tags, ext := splitOSArchTags(&buildCtx, gofile)
69
openFile := func(name string) (*os.File, func()) {
70
- p := filepath.Join(workDir, name)
71
var f *os.File
72
// nolint: gofumpt
73
// nolint: nolintlint
74
- f, err = os.OpenFile(p, os.O_WRONLY|os.O_CREATE|os.O_TRUNC, 0666)
+ // nolint: gosec
+ f, err = os.OpenFile(
75
+ filepath.Join(workDir, filepath.Clean(name)),
76
+ os.O_WRONLY|os.O_CREATE|os.O_TRUNC,
77
+ 0600,
78
+ )
79
if err != nil {
80
log.Fatal(err)
81
}
0 commit comments