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:
parent
6c24da551b
commit
3b53334d87
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue