Declare OpenBSD pledge(2) (#5)
This commit is contained in:
14
main.go
14
main.go
@@ -2,8 +2,10 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/maximbaz/browserpass-native/openbsd"
|
||||
log "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
@@ -17,16 +19,18 @@ func main() {
|
||||
flag.BoolVar(&version, "version", false, "print version and exit")
|
||||
flag.Parse()
|
||||
|
||||
if version {
|
||||
fmt.Println("Browserpass host app version:", VERSION)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
openbsd.Pledge("stdio rpath proc exec")
|
||||
|
||||
log.SetFormatter(&log.TextFormatter{FullTimestamp: true})
|
||||
if verbose {
|
||||
log.SetLevel(log.DebugLevel)
|
||||
}
|
||||
|
||||
if version {
|
||||
log.Info("Browserpass host app version: ", VERSION)
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
log.Debugf("Starting browserpass host app v%v", VERSION)
|
||||
process()
|
||||
}
|
||||
|
Reference in New Issue
Block a user