Skip to content
Myr

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

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Aaron Bieber · committed by Junegunn Choi · parent 7771241 · Browse files · 3 files+23 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+23 added−1 removed

  • other:+23 added−1 removed

3 files+23 added−1 removed

added:src/protector/protector_openbsd.go+10 added
1// +build openbsd23package protector45import "golang.org/x/sys/unix"67// Protect calls OS specific protections like pledge on OpenBSD8func Protect() {9 unix.PledgePromises("stdio rpath tty proc exec")10}
added:src/protector/protector.go+8 added
1// +build !openbsd23package protector45// Protect calls OS specific protections like pledge on OpenBSD6func Protect() {7 return8}
modified:main.go+5 added-1 removed
1package main23import (3import "github.com/junegunn/fzf/src"4 "github.com/junegunn/fzf/src"5 "github.com/junegunn/fzf/src/protector"6)78var revision string910func main() {11 protector.Protect()12 fzf.Run(fzf.ParseOptions(), revision)13}