actually add the protect stuff

This commit is contained in:
Aaron Bieber 2020-02-02 11:16:08 -07:00
parent aa6e22ff39
commit 10a5e5eecf
2 changed files with 27 additions and 0 deletions

7
protect.go Normal file
View File

@ -0,0 +1,7 @@
//+build !openbsd
package main
func unveil(path string, flags string) {}
func unveilBlock() {}
func pledge(promises string) {}

20
protect_openbsd.go Normal file
View File

@ -0,0 +1,20 @@
//+build openbsd
package main
import (
"golang.org/x/sys/unix"
)
func unveil(path string, flags string) {
unix.Unveil(path, flags)
}
func unveilBlock() {
unix.UnveilBlock()
}
func plegde(promises string) {
unix.PledgePromises(promises)
}