token/disk: write token with 0600

This commit is contained in:
Mitchell Hashimoto 2015-05-02 13:34:01 -07:00
parent 8ff38717eb
commit deab183cbd
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
## 0.1.1 (May 2, 2015)
SECURITY CHANGES:
* token/disk: write the token to disk with 0600 perms
IMPROVEMENTS:
* core: Very verbose error if mlock fails [GH-59]

View File

@ -56,7 +56,7 @@ func (c *Command) Run(args []string) int {
return 1
}
case "store":
f, err := os.Create(path)
f, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, 0600)
if err != nil {
fmt.Fprintf(os.Stderr, "%s\n", err)
return 1