Fix pledge() usage

This commit is contained in:
Frank Denis 2018-07-07 20:50:44 +02:00
parent 35e4d36f67
commit 17e07d80bb
3 changed files with 13 additions and 3 deletions

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() {
}

View File

@ -39,6 +39,7 @@ func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) {
} }
SystemDNotify() SystemDNotify()
PledgeChild()
args = args[1:] args = args[1:]
args = append(args, "-child") args = append(args, "-child")