~qbit/protect

38a2541667f0f93afd74ab6552a4b18e9a2f9e35 — Aaron Bieber 1 year, 5 months ago 7443e57 v1.0.0
add returns
3 files changed, 17 insertions(+), 11 deletions(-)

M protect.go
M protect_openbsd.go
M protect_stubs.go
M protect.go => protect.go +4 -4
@@ 16,8 16,8 @@ package protect
// Preventing access to anything else.
//
// On non-OpenBSD machines this call is a noop.
func Unveil(path string, flags string) {
	unveil(path, flags)
func Unveil(path string, flags string) error {
	return unveil(path, flags)
}

// UnveilBlock locks the Unveil'd paths. Preventing further changes to a


@@ 32,6 32,6 @@ func UnveilBlock() error {
// the system calls a process can make.
//
// On non-OpenBSD machines this call is a noop.
func Pledge(promises string) {
	pledge(promises)
func Pledge(promises string) error {
	return pledge(promises)
}

M protect_openbsd.go => protect_openbsd.go +4 -4
@@ 6,14 6,14 @@ import (
	"golang.org/x/sys/unix"
)

func unveil(path string, flags string) {
	unix.Unveil(path, flags)
func unveil(path string, flags string) error {
	return unix.Unveil(path, flags)
}

func unveilBlock() error {
	return unix.UnveilBlock()
}

func pledge(promises string) {
	unix.PledgePromises(promises)
func pledge(promises string) error {
	return unix.PledgePromises(promises)
}

M protect_stubs.go => protect_stubs.go +9 -3
@@ 2,8 2,14 @@

package protect

func unveil(path string, flags string) {}
func unveil(path string, flags string) error {
	return nil
}

func unveilBlock() error {}
func unveilBlock() error {
	return nil
}

func pledge(promises string) {}
func pledge(promises string) error {
	return nil
}