write and update the netrc with safe perms
This commit is contained in:
parent
a3991af0ae
commit
e0c0cb6f32
2 changed files with 28 additions and 1 deletions
|
|
@ -132,5 +132,8 @@ func write(path string, entries []entry) error {
|
|||
fmt.Fprintf(&b, "machine %s\npassword %s\n", e.machine, e.password)
|
||||
}
|
||||
|
||||
return os.WriteFile(path, []byte(b.String()), 0600)
|
||||
if err := os.WriteFile(path, []byte(b.String()), 0600); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.Chmod(path, 0600)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue