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

View File

@ -2,9 +2,14 @@
package main package main
import "golang.org/x/sys/unix" import (
"golang.org/x/sys/unix"
)
func Pledge() { func Pledge() {
unix.Pledge("stdio rpath wpath cpath tmppath inet fattr flock dns getpw sendfd recvfd proc exec id", unix.Pledge("stdio rpath wpath cpath tmppath inet fattr flock dns getpw sendfd recvfd proc exec id", nil)
"stdio rpath wpath cpath tmppath inet fattr flock dns recvfd") }
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 Pledge() {
} }
func PledgeChild() {
}