Skip to content
Snippets Groups Projects
Commit a1bcdc22 authored by Aaron Bieber's avatar Aaron Bieber Committed by Junegunn Choi
Browse files

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

parent 7771241c
No related branches found
No related tags found
No related merge requests found
package main
import "github.com/junegunn/fzf/src"
import (
"github.com/junegunn/fzf/src"
"github.com/junegunn/fzf/src/protector"
)
var revision string
func main() {
protector.Protect()
fzf.Run(fzf.ParseOptions(), revision)
}
// +build !openbsd
package protector
// Protect calls OS specific protections like pledge on OpenBSD
func Protect() {
return
}
// +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")
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment