added support for config files, openbsd, pledge and unveil
This commit is contained in:
parent
62543e44da
commit
375933c7bc
14 changed files with 138 additions and 49 deletions
|
|
@ -3,6 +3,7 @@
|
|||
package log
|
||||
|
||||
import (
|
||||
"git.giftfish.de/ston1th/godrop/v2"
|
||||
stdlog "log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
|
@ -18,7 +19,13 @@ func InitLogger(dir, file string, d bool) {
|
|||
if file == "-" {
|
||||
return
|
||||
}
|
||||
f, err := os.OpenFile(filepath.Join(dir, file), os.O_RDWR|os.O_CREATE|os.O_APPEND, 0640)
|
||||
logfile := filepath.Join(dir, file)
|
||||
err := godrop.Unveil(logfile, "rwc")
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
return
|
||||
}
|
||||
f, err := os.OpenFile(logfile, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0640)
|
||||
if err != nil {
|
||||
stdlog.Fatal(err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue