diff --git a/dnscrypt-proxy/main.go b/dnscrypt-proxy/main.go index 3a64d745..38f00ca0 100644 --- a/dnscrypt-proxy/main.go +++ b/dnscrypt-proxy/main.go @@ -25,6 +25,8 @@ type App struct { func main() { dlog.Init("dnscrypt-proxy", dlog.SeverityNotice, "DAEMON") + Pledge() + pwd, err := os.Getwd() if err != nil { dlog.Fatal("Unable to find the path to the current directory") diff --git a/dnscrypt-proxy/pledge_openbsd.go b/dnscrypt-proxy/pledge_openbsd.go new file mode 100644 index 00000000..5294f5b2 --- /dev/null +++ b/dnscrypt-proxy/pledge_openbsd.go @@ -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") +} diff --git a/dnscrypt-proxy/pledge_others.go b/dnscrypt-proxy/pledge_others.go new file mode 100644 index 00000000..4b791db0 --- /dev/null +++ b/dnscrypt-proxy/pledge_others.go @@ -0,0 +1,7 @@ +// +build !openbsd + +package main + +func Pledge() { + +}