Fix pledge() usage
This commit is contained in:
parent
35e4d36f67
commit
17e07d80bb
|
@ -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)
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,3 +5,7 @@ package main
|
||||||
func Pledge() {
|
func Pledge() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func PledgeChild() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue