Commit a24cb0d9 authored by Frank Denis's avatar Frank Denis

Revert "Remove pledge(2) support"

This reverts commit bc3215a8.
parent bc3215a8
......@@ -193,6 +193,9 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
flag.Parse()
if *child {
PledgeChild()
}
if *svcFlag == "stop" || *svcFlag == "uninstall" {
return nil
}
......
......@@ -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")
......
// +build openbsd
package main
import (
"golang.org/x/sys/unix"
)
func Pledge() {
unix.Pledge("stdio rpath wpath cpath tmppath inet fattr flock dns getpw sendfd recvfd proc exec id", nil)
}
func PledgeChild() {
unix.Pledge("stdio rpath wpath cpath tmppath inet fattr flock dns recvfd", nil)
}
// +build !openbsd
package main
func Pledge() {
}
func PledgeChild() {
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment