diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-07-02 00:32:48 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-07-02 00:32:48 +0900 |
| commit | 26b7afc890e23af19fe6662fd27f46b47e9feea9 (patch) | |
| tree | 9c6375c4d46e5767b01826eb90ba50d0ae4c9f99 /sandbox/seccomp/libseccomp.go | |
| parent | d5532aade0c3f042c5daa7d1c16e7cce2f4b524a (diff) | |
sandbox/seccomp: prepare -> export
Export makes a lot more sense, and also matches the libseccomp function.
Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'sandbox/seccomp/libseccomp.go')
| -rw-r--r-- | sandbox/seccomp/libseccomp.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sandbox/seccomp/libseccomp.go b/sandbox/seccomp/libseccomp.go index 28a9628b..d28df638 100644 --- a/sandbox/seccomp/libseccomp.go +++ b/sandbox/seccomp/libseccomp.go @@ -64,15 +64,15 @@ type NativeRule struct { Arg *ScmpArgCmp } -type PrepareFlag = C.hakurei_prepare_flag +type ExportFlag = C.hakurei_export_flag const ( // AllowMultiarch allows multiarch/emulation. - AllowMultiarch PrepareFlag = C.HAKUREI_PREPARE_MULTIARCH + AllowMultiarch ExportFlag = C.HAKUREI_EXPORT_MULTIARCH // AllowCAN allows AF_CAN. - AllowCAN PrepareFlag = C.HAKUREI_PREPARE_CAN + AllowCAN ExportFlag = C.HAKUREI_EXPORT_CAN // AllowBluetooth allows AF_BLUETOOTH. - AllowBluetooth PrepareFlag = C.HAKUREI_PREPARE_BLUETOOTH + AllowBluetooth ExportFlag = C.HAKUREI_EXPORT_BLUETOOTH ) var resPrefix = [...]string{ @@ -86,8 +86,8 @@ var resPrefix = [...]string{ 7: "seccomp_load failed", } -// Prepare streams filter contents to fd, or installs it to the current process if fd < 0. -func Prepare(fd int, rules []NativeRule, flags PrepareFlag) error { +// Export streams filter contents to fd, or installs it to the current process if fd < 0. +func Export(fd int, rules []NativeRule, flags ExportFlag) error { if len(rules) == 0 { return ErrInvalidRules } @@ -119,7 +119,7 @@ func Prepare(fd int, rules []NativeRule, flags PrepareFlag) error { rulesPinner.Pin(rule.Arg) } } - res, err := C.hakurei_prepare_filter( + res, err := C.hakurei_export_filter( &ret, C.int(fd), arch, multiarch, (*C.struct_hakurei_syscall_rule)(unsafe.Pointer(&rules[0])), |
