diff options
author | Paul Moore <paul@paul-moore.com> | 2016-02-22 16:55:48 -0500 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2016-02-22 16:55:48 -0500 |
commit | 4d29f58649cbd1fbf13e95aeac5208eb5638b436 (patch) | |
tree | 1c6ba088df4eced135f4c87c76167b5223a4e7dc | |
parent | 173b96ba8d36a4b1954e99570e82f2f932fe056a (diff) | |
download | libseccomp-4d29f58649cbd1fbf13e95aeac5208eb5638b436.tar.gz |
python: update the python bindings to match the C version
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | src/python/libseccomp.pxd | 17 | ||||
-rw-r--r-- | src/python/seccomp.pyx | 2 |
2 files changed, 18 insertions, 1 deletions
diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd index b74e8b7..15c94f8 100644 --- a/src/python/libseccomp.pxd +++ b/src/python/libseccomp.pxd @@ -23,6 +23,11 @@ from libc.stdint cimport uint8_t, uint32_t, uint64_t cdef extern from "seccomp.h": + cdef struct scmp_version: + unsigned int major + unsigned int minor + unsigned int micro + ctypedef void* scmp_filter_ctx cdef enum: @@ -48,6 +53,7 @@ cdef extern from "seccomp.h": SCMP_FLTATR_ACT_DEFAULT SCMP_FLTATR_ACT_BADARCH SCMP_FLTATR_CTL_NNP + SCMP_FLTATR_CTL_TSYNC cdef enum scmp_compare: SCMP_CMP_NE @@ -73,6 +79,8 @@ cdef extern from "seccomp.h": scmp_datum_t datum_a scmp_datum_t datum_b + scmp_version *seccomp_version() + scmp_filter_ctx seccomp_init(uint32_t def_action) int seccomp_reset(scmp_filter_ctx ctx, uint32_t def_action) void seccomp_release(scmp_filter_ctx ctx) @@ -101,9 +109,16 @@ cdef extern from "seccomp.h": int seccomp_rule_add(scmp_filter_ctx ctx, uint32_t action, int syscall, unsigned int arg_cnt, ...) - + int seccomp_rule_add_array(scmp_filter_ctx ctx, + uint32_t action, int syscall, + unsigned int arg_cnt, + scmp_arg_cmp *arg_array) int seccomp_rule_add_exact(scmp_filter_ctx ctx, uint32_t action, int syscall, unsigned int arg_cnt, ...) + int seccomp_rule_add_exact_array(scmp_filter_ctx ctx, + uint32_t action, int syscall, + unsigned int arg_cnt, + scmp_arg_cmp *arg_array) int seccomp_export_pfc(scmp_filter_ctx ctx, int fd) int seccomp_export_bpf(scmp_filter_ctx ctx, int fd) diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx index 1724dd6..c87bc3f 100644 --- a/src/python/seccomp.pyx +++ b/src/python/seccomp.pyx @@ -240,10 +240,12 @@ cdef class Attr: ACT_DEFAULT - the filter's default action ACT_BADARCH - the filter's bad architecture action CTL_NNP - the filter's "no new privileges" flag + CTL_NNP - the filter's thread sync flag """ ACT_DEFAULT = libseccomp.SCMP_FLTATR_ACT_DEFAULT ACT_BADARCH = libseccomp.SCMP_FLTATR_ACT_BADARCH CTL_NNP = libseccomp.SCMP_FLTATR_CTL_NNP + CTL_TSYNC = libseccomp.SCMP_FLTATR_CTL_TSYNC cdef class Arg: """ Python object representing a SyscallFilter syscall argument. |