fortify/helper/helper.go
Ophestra 73c1a83032
All checks were successful
Test / Create distribution (push) Successful in 27s
Test / Fortify (push) Successful in 2m42s
Test / Fpkg (push) Successful in 3m49s
Test / Data race detector (push) Successful in 4m1s
Test / Flake checks (push) Successful in 59s
helper: move process wrapper to direct
Signed-off-by: Ophestra <cat@gensokyo.uk>
2025-03-15 00:33:25 +09:00

31 lines
561 B
Go

// Package helper runs external helpers with optional sandboxing.
package helper
import (
"fmt"
"os/exec"
"time"
)
var (
WaitDelay = 2 * time.Second
commandContext = exec.CommandContext
)
const (
// FortifyHelper is set to 1 when args fd is enabled and 0 otherwise.
FortifyHelper = "FORTIFY_HELPER"
// FortifyStatus is set to 1 when stat fd is enabled and 0 otherwise.
FortifyStatus = "FORTIFY_STATUS"
)
type Helper interface {
// Start starts the helper process.
Start() error
// Wait blocks until Helper exits.
Wait() error
fmt.Stringer
}