Sensible permissions on creating a file

Open a file, create it if it doesn't exist, and for gods sake don't leave it 0666.
This commit is contained in:
jjshoe 2015-04-29 13:13:18 -05:00 committed by 💩
parent 6c24da551b
commit 3b53334d87
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ func (b *FileBackend) Put(entry *Entry) error {
}
// JSON encode the entry and write it
f, err := os.Create(filepath.Join(path, key))
f, err := os.OpenFile(filepath.Join(path, key), os.O_CREATE|os.O_TRUNC, 0600)
if err != nil {
return err
}