fix permissions of socket and log files

cc #726
This commit is contained in:
Gokcehan committed 2022-01-22 13:47:18 +03:00
1 parent ac4bdccf8d
commit 081d0585cd
2 files changed
+15

No files matched your search

+4
View File
@@ -29,6 +29,10 @@ func run() {
if err != nil {
panic(err)
}
err = os.Chmod(gLogPath, 0600)
if err != nil {
panic(err)
}
defer f.Close()
log.SetOutput(f)
+11
View File
@@ -20,6 +20,10 @@ func serve() {
if err != nil {
panic(err)
}
err = os.Chmod(gServerLogPath, 0600)
if err != nil {
panic(err)
}
defer f.Close()
log.SetOutput(f)
@@ -30,6 +34,13 @@ func serve() {
log.Printf("listening socket: %s", err)
return
}
if gSocketProt == "unix" {
err = os.Chmod(gSocketPath, 0600)
if err != nil {
log.Printf("chmod socket: %s", err)
return
}
}
defer l.Close()
gListener = l