pledge() on OpenBSD

This commit is contained in:
Frank Denis 2018-07-07 20:27:09 +02:00
parent 4dc756be4d
commit 1f54214821
3 changed files with 19 additions and 0 deletions

View File

@ -25,6 +25,8 @@ type App struct {
func main() { func main() {
dlog.Init("dnscrypt-proxy", dlog.SeverityNotice, "DAEMON") dlog.Init("dnscrypt-proxy", dlog.SeverityNotice, "DAEMON")
Pledge()
pwd, err := os.Getwd() pwd, err := os.Getwd()
if err != nil { if err != nil {
dlog.Fatal("Unable to find the path to the current directory") dlog.Fatal("Unable to find the path to the current directory")

View File

@ -0,0 +1,10 @@
// +build openbsd
package main
import "unix"
func Pledge() {
unix.Pledge("stdio rpath wpath cpath tmppath inet fattr flock dns getpw sendfd recvfd proc exec id",
"stdio rpath wpath cpath tmppath inet fattr flock dns recvfd")
}

View File

@ -0,0 +1,7 @@
// +build !openbsd
package main
func Pledge() {
}