summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Moore <pmoore@redhat.com>2015-06-12 14:18:06 -0400
committerPaul Moore <pmoore@redhat.com>2015-07-13 10:29:36 -0400
commitc5d3e1d692710cca958ea218660c1877245fce67 (patch)
tree9c8c7a32cf289c7d584100a7645e965591fbb7e6
parentacc895703daf72d6c9a83db2b7a0f8ff73b37ad5 (diff)
downloadlibseccomp-c5d3e1d692710cca958ea218660c1877245fce67.tar.gz
python: add s390 and s390x support
Signed-off-by: Paul Moore <pmoore@redhat.com>
-rw-r--r--src/python/libseccomp.pxd2
-rw-r--r--src/python/seccomp.pyx6
-rwxr-xr-xtests/26-sim-arch_all_be_basic.py2
3 files changed, 10 insertions, 0 deletions
diff --git a/src/python/libseccomp.pxd b/src/python/libseccomp.pxd
index 2b50f3f..ec8d53c 100644
--- a/src/python/libseccomp.pxd
+++ b/src/python/libseccomp.pxd
@@ -38,6 +38,8 @@ cdef extern from "seccomp.h":
SCMP_ARCH_MIPSEL
SCMP_ARCH_MIPSEL64
SCMP_ARCH_MIPSEL64N32
+ SCMP_ARCH_S390
+ SCMP_ARCH_S390X
cdef enum scmp_filter_attr:
SCMP_FLTATR_ACT_DEFAULT
diff --git a/src/python/seccomp.pyx b/src/python/seccomp.pyx
index 686f7d2..823e50a 100644
--- a/src/python/seccomp.pyx
+++ b/src/python/seccomp.pyx
@@ -163,6 +163,8 @@ cdef class Arch:
MIPSEL = libseccomp.SCMP_ARCH_MIPSEL
MIPSEL64 = libseccomp.SCMP_ARCH_MIPSEL64
MIPSEL64N32 = libseccomp.SCMP_ARCH_MIPSEL64N32
+ S390 = libseccomp.SCMP_ARCH_S390
+ S390X = libseccomp.SCMP_ARCH_S390X
def __cinit__(self, arch=libseccomp.SCMP_ARCH_NATIVE):
""" Initialize the architecture object.
@@ -198,6 +200,10 @@ cdef class Arch:
self._token = libseccomp.SCMP_ARCH_MIPSEL64
elif arch == libseccomp.SCMP_ARCH_MIPSEL64N32:
self._token = libseccomp.SCMP_ARCH_MIPSEL64N32
+ elif arch == libseccomp.SCMP_ARCH_S390:
+ self._token = libseccomp.SCMP_ARCH_S390
+ elif arch == libseccomp.SCMP_ARCH_S390X:
+ self._token = libseccomp.SCMP_ARCH_S390X
else:
self._token = 0;
elif isinstance(arch, basestring):
diff --git a/tests/26-sim-arch_all_be_basic.py b/tests/26-sim-arch_all_be_basic.py
index 1347406..3da63f0 100755
--- a/tests/26-sim-arch_all_be_basic.py
+++ b/tests/26-sim-arch_all_be_basic.py
@@ -33,6 +33,8 @@ def test(args):
f.add_arch(Arch("mips"))
f.add_arch(Arch("mips64"))
f.add_arch(Arch("mips64n32"))
+ f.add_arch(Arch("s390"))
+ f.add_arch(Arch("s390x"))
f.add_rule(ALLOW, "read", Arg(0, EQ, sys.stdin.fileno()))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stdout.fileno()))
f.add_rule(ALLOW, "write", Arg(0, EQ, sys.stderr.fileno()))