Skip to content

Commit

Permalink
fix bug on log file permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
antavelos committed Jul 30, 2017
1 parent 716e587 commit 8cca831
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func getAppDir() (string, error) {
dir := path.Join(usr.HomeDir, ".terminews")
if _, err := os.Stat(dir); err != nil {
if os.IsNotExist(err) {
if oserr := os.Mkdir(dir, 0666); oserr != nil {
if oserr := os.Mkdir(dir, 0700); oserr != nil {
return "", oserr
}
} else {
Expand All @@ -145,7 +145,7 @@ func main() {

// Setup logging
logfile := path.Join(appDir, "terminews.log")
f, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666)
f, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0700)
if err != nil {
log.Fatal("Failed to open logfile", err)
}
Expand Down

0 comments on commit 8cca831

Please sign in to comment.