Skip to content
This repository has been archived by the owner on Jun 14, 2018. It is now read-only.

Commit

Permalink
Handle permission denied when looking for home directory
Browse files Browse the repository at this point in the history
  • Loading branch information
calmh committed Dec 9, 2013
1 parent b79be25 commit d8a80af
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/mole/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ func ensureHome() {
err := os.MkdirAll(homeDir, 0700)
fatalErr(err)
okln("Created", homeDir)
} else if fi.Mode()&0077 != 0 {
} else if err != nil {
fatalErr(err)
}
if fi.Mode()&0077 != 0 {
err := os.Chmod(homeDir, 0700)
fatalErr(err)
okln("Corrected permissions on", homeDir)
Expand Down

0 comments on commit d8a80af

Please sign in to comment.