resolve host for every new connection in static tunnels

This commit is contained in:
octeep 2022-04-04 20:45:28 +01:00
parent 06d425be3a
commit f637b0f916
No known key found for this signature in database
GPG key ID: D8251F73BE242851
2 changed files with 56 additions and 37 deletions

View file

@ -45,11 +45,9 @@ func main() {
exePath := executablePath()
unveilOrPanic("/", "r")
unveilOrPanic(exePath, "x")
if err := protect.UnveilBlock(); err != nil {
log.Fatal(err)
}
// only allow standard stdio operation, file reading, networking, and exec
// also remove unveil permission to lock unveil
pledgeOrPanic("stdio rpath inet dns proc exec")
isDaemonProcess := len(os.Args) > 1 && os.Args[1] == daemonProcess