Skip to content

Commit aa944f0

Browse files
micsthepickmicsthepickplusvic
authored
fix: make configuration file readable only to the user who create it (#117)
When the `vt init` command is run, configuration file `.vt.toml` is created. This file was created with permissions 0666, who allowed everyone to read it. With this change the file is created with permissions 0600, so that only the user who created can read it or write it. --------- Co-authored-by: micsthepick <[email protected]> Co-authored-by: Victor M. Alvarez <[email protected]>
1 parent eb5dbbc commit aa944f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cmd/init.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func NewInitCmd() *cobra.Command {
8989
}
9090

9191
configFilePath := path.Join(dir, ".vt.toml")
92-
configFile, err := os.Create(configFilePath)
92+
configFile, err := os.OpenFile(configFilePath, os.O_CREATE|os.O_WRONLY, 0600)
9393
if err != nil {
9494
fmt.Fprintln(os.Stderr, err)
9595
os.Exit(1)

0 commit comments

Comments
 (0)