Merge branch 'master' of github.com:jedisct1/dnscrypt-proxy

* 'master' of github.com:jedisct1/dnscrypt-proxy:
  Don't call PledgeChild() too early
  Fix pledge() usage
  Store the userName value again
This commit is contained in:
Frank Denis 2018-07-09 14:31:40 +02:00
commit 9234014f17
3 changed files with 17 additions and 3 deletions

View File

@ -193,6 +193,9 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
flag.Parse()
if *child {
PledgeChild()
}
if *svcFlag == "stop" || *svcFlag == "uninstall" {
return nil
}
@ -240,6 +243,8 @@ func ConfigLoad(proxy *Proxy, svcFlag *string) error {
proxy.logMaxAge = config.LogMaxAge
proxy.logMaxBackups = config.LogMaxBackups
proxy.userName = config.UserName
proxy.child = *child
proxy.xTransport = NewXTransport()
proxy.xTransport.tlsDisableSessionTickets = config.TLSDisableSessionTickets

View File

@ -2,9 +2,14 @@
package main
import "golang.org/x/sys/unix"
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",
"stdio rpath wpath cpath tmppath inet fattr flock dns recvfd")
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)
}

View File

@ -5,3 +5,7 @@ package main
func Pledge() {
}
func PledgeChild() {
}