diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-03-12 15:18:52 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-03-12 15:18:52 +0900 |
| commit | be16970e770554b3c2191da41eb9bd4472b323e4 (patch) | |
| tree | a1c76f09b55ce44a6e0997147e24f0713c332089 /helper/seccomp/seccomp.go | |
| parent | df266527f17987af4bf275cc04990bfb89a82f4a (diff) | |
helper/seccomp: seccomp_load on negative fd
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'helper/seccomp/seccomp.go')
| -rw-r--r-- | helper/seccomp/seccomp.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/helper/seccomp/seccomp.go b/helper/seccomp/seccomp.go index a8cf8bb2..fc192474 100644 --- a/helper/seccomp/seccomp.go +++ b/helper/seccomp/seccomp.go @@ -3,7 +3,7 @@ package seccomp /* #cgo linux pkg-config: --static libseccomp -#include "seccomp-export.h" +#include "seccomp-build.h" */ import "C" import ( @@ -22,6 +22,7 @@ var resErr = [...]error{ 4: errors.New("internal libseccomp failure"), 5: errors.New("seccomp_rule_add failed"), 6: errors.New("seccomp_export_bpf failed"), + 7: errors.New("seccomp_load failed"), } type SyscallOpts = C.f_syscall_opts @@ -46,7 +47,7 @@ const ( FlagBluetooth SyscallOpts = C.F_BLUETOOTH ) -func exportFilter(fd uintptr, opts SyscallOpts) error { +func buildFilter(fd int, opts SyscallOpts) error { var ( arch C.uint32_t = 0 multiarch C.uint32_t = 0 @@ -70,7 +71,7 @@ func exportFilter(fd uintptr, opts SyscallOpts) error { opts |= flagVerbose } - res, err := C.f_export_bpf(C.int(fd), arch, multiarch, opts) + res, err := C.f_build_filter(C.int(fd), arch, multiarch, opts) if re := resErr[res]; re != nil { if err == nil { return re |
