forked from security/hakurei
sandbox/seccomp: syscall name lookup table
The script is from Go source of same name. The result is checked against libseccomp. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
// LibraryError represents a libseccomp error.
|
||||
@@ -114,3 +115,11 @@ func buildFilter(fd int, opts FilterOpts) error {
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// only used for testing
|
||||
func syscallResolveName(s string) (trap int) {
|
||||
v := C.CString(s)
|
||||
trap = int(C.seccomp_syscall_resolve_name(v))
|
||||
C.free(unsafe.Pointer(v))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user