Add pledge(2) support (OpenBSD only) via a 'protector' package. (#1297)

This commit is contained in:
Aaron Bieber authored and Junegunn Choi committed 2020-01-19 14:13:32 +09:00
1 parent 7771241cc0
commit a1bcdc225e
3 files changed
+23 -1

No files matched your search

+10
View File
@@ -0,0 +1,10 @@
// +build openbsd
package protector
import "golang.org/x/sys/unix"
// Protect calls OS specific protections like pledge on OpenBSD
func Protect() {
unix.PledgePromises("stdio rpath tty proc exec")
}