Fix permissions of tempfile

Signed-off-by: Sevag Hanssian <sevag.hanssian@gmail.com>
This commit is contained in:
Sevag Hanssian 2018-11-02 09:58:51 -07:00
parent 924d5919f3
commit 88f4223778
No known key found for this signature in database
GPG Key ID: 15472D208B254CF4
1 changed files with 4 additions and 0 deletions

View File

@ -562,6 +562,10 @@ func WriteToTextfile(filename string, g Gatherer) error {
if err := tmp.Close(); err != nil { if err := tmp.Close(); err != nil {
return err return err
} }
if err := os.Chmod(tmp.Name(), 0644); err != nil {
return err
}
return os.Rename(tmp.Name(), filename) return os.Rename(tmp.Name(), filename)
} }