Commit 17e07d80 authored by Frank Denis's avatar Frank Denis

Fix pledge() usage

parent 35e4d36f
......@@ -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)
}
......@@ -5,3 +5,7 @@ package main
func Pledge() {
}
func PledgeChild() {
}
......@@ -39,6 +39,7 @@ func (proxy *Proxy) dropPrivilege(userStr string, fds []*os.File) {
}
SystemDNotify()
PledgeChild()
args = args[1:]
args = append(args, "-child")
......
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