sandbox/seccomp: native rule slice in helpers
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 2m6s
Test / Hakurei (push) Successful in 2m49s
Test / Sandbox (race detector) (push) Successful in 3m8s
Test / Planterette (push) Successful in 3m33s
Test / Hakurei (race detector) (push) Successful in 4m16s
Test / Flake checks (push) Successful in 1m16s
All checks were successful
Test / Create distribution (push) Successful in 32s
Test / Sandbox (push) Successful in 2m6s
Test / Hakurei (push) Successful in 2m49s
Test / Sandbox (race detector) (push) Successful in 3m8s
Test / Planterette (push) Successful in 3m33s
Test / Hakurei (race detector) (push) Successful in 4m16s
Test / Flake checks (push) Successful in 1m16s
These helper functions took FilterPreset as input for ease of integration. This moves them to []NativeRule. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -8,9 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type exporter struct {
|
||||
presets FilterPreset
|
||||
flags PrepareFlag
|
||||
r, w *os.File
|
||||
rules []NativeRule
|
||||
flags PrepareFlag
|
||||
r, w *os.File
|
||||
|
||||
prepareOnce sync.Once
|
||||
prepareErr error
|
||||
@@ -30,7 +30,7 @@ func (e *exporter) prepare() error {
|
||||
|
||||
ec := make(chan error, 1)
|
||||
go func(fd uintptr) {
|
||||
ec <- preparePreset(int(fd), e.presets, e.flags)
|
||||
ec <- Prepare(int(fd), e.rules, e.flags)
|
||||
close(ec)
|
||||
_ = e.closeWrite()
|
||||
runtime.KeepAlive(e.w)
|
||||
@@ -55,6 +55,6 @@ func (e *exporter) closeWrite() error {
|
||||
return e.closeErr
|
||||
}
|
||||
|
||||
func newExporter(presets FilterPreset, flags PrepareFlag) *exporter {
|
||||
return &exporter{presets: presets, flags: flags}
|
||||
func newExporter(rules []NativeRule, flags PrepareFlag) *exporter {
|
||||
return &exporter{rules: rules, flags: flags}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user