summaryrefslogtreecommitdiff
path: root/src/python
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'working-s390' into masterPaul Moore2015-08-282-4/+12
|\ | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
| * python: add s390 and s390x supportPaul Moore2015-07-132-0/+8
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | Merge branch 'working-ppc64'Paul Moore2015-08-052-0/+14
|\ \ | |/ |/| | | | | | | Mike Strosaker <strosake@linux.vnet.ibm.com> reports that the working-ppc64 branch is working for both 'make check' and './regression -T live'.
| * arch: add basic initial ppc support to the arch-dependent codeBogdan Purcareata2015-02-172-1/+6
| | | | | | | | | | Signed-off-by: Bogdan Purcareata <bogdan.purcareata@freescale.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
| * arch: add the basic initial support for ppc64 to the arch-dependent codePaul Moore2015-02-062-0/+9
| | | | | | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* | python: ensure attributes are treated as 32 bitsMike Strosaker2015-05-061-1/+1
|/ | | | | | | | | | | Retrieving attributes using the Python bindings fails on some platforms. The attributes are encoded in a 32-bit mask. Python variables are usually larger (64 bits); Cython is not capable of recognizing that it should only use a 32-bit number on every platform. This patch ensures that the variable used to store the value of the attribute is only 32 bits. Signed-off-by: Michael Strosaker <strosake@linux.vnet.ibm.com> Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: fix some problems seen with 'make dist' tarballsPaul Moore2014-10-211-0/+2
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: allow the creation of a static libraryPaul Moore2014-10-212-2/+2
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: Add AArch64 supportMarcin Juszkiewicz2014-08-272-0/+5
| | | | | | | | This patch adds support for AArch64 (64-bit ARM) architecture. Signed-off-by: Marcin Juszkiewicz <mjuszkiewicz@redhat.com> (Additional fixes/corrections/etc.) Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: add the missing 64-bit MIPS cython/python bindingsPaul Moore2014-08-212-2/+22
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* tests: check the number of arguments to the rule_add*() functionsPaul Moore2014-08-201-0/+4
| | | | | | | Without this check we run the risk of segfaults when the number of arguments reach beyond six. Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: rename seccomp_syscall_resolve_name_rewrite_arch()Paul Moore2014-05-092-3/+2
| | | | | | Change the API name to seccomp_syscall_resolve_name_rewrite(). Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: add an API to do translated/rewriten syscall resolutionPaul Moore2014-05-082-1/+3
| | | | | | | This patch also converts the seccomp.resolve_syscall() method to use the new resolution API. Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: add the seccomp_arch_resolve_name() API callPaul Moore2014-05-072-2/+47
| | | | | | As requested by the systemd developers and used by our own tools. Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: fix a build problem related to PEP 3123Paul Moore2014-05-071-1/+4
| | | | | | | We also add some comments to setup.py to explain the "extra" options so we remember why we are doing this in the future. Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: fix the autotools build for the python bindingsPaul Moore2014-05-072-4/+4
| | | | | | | | | Python's distutils/setup.py doesn't play well with libtool libraries so directly reference the static libseccomp library inside setup.py. Also fix a problem with the automake configuration which likely masked this problem in the first place. Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: add headers to all of the autotools filesPaul Moore2014-05-011-1/+17
| | | | | | There are also some minor cosmetic tweaks to the files. Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: fixup the autotools build flagsPaul Moore2014-04-292-4/+5
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: cleanup version dependent aspects of the autotools buildPaul Moore2014-04-291-1/+1
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: enable python bindings support in the autotools frameworkPaul Moore2014-04-291-10/+14
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* build: initial attempt to use autotools as the build systemJan Engelhardt2014-04-293-55/+25
| | | | | | | | | | | | With my apologies to Jan for delaying this patch for so long, there are a number of differences between Jan's original patch and what is being merged in this patch; almost all of the changes are due to changes in the underlying code base, but there are a few minor fixes as well. Signed-off-by: Jan Engelhardt <jengelh@inai.de> Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: add MIPS and MIPSEL to the python bindingsPaul Moore2014-04-152-0/+6
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: fix runtime problems with Cython 0.20Paul Moore2014-02-071-5/+5
| | | | | | | | | The uint32_t type used for the arch_token was causing problems with Cython/Python as some (all?) of the arch tokens were considered to be negative numbers. This patch changes the unsigned int type to int to make Cython/Python happy; this should not cause any problems. Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: fix build problems with Cython 0.20Paul Moore2014-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | | Resolve the following build problem with Cython 0.20; I've also tested this change on Cython 0.19.2 without problem. >>> Error compiling Cython file: ------------------------------------------------------------ ... Helper function which should only be used internally by SyscallFilter objects and exists for the sole purpose of making it easier to deal with the varadic functions of the libseccomp API, e.g. seccomp_rule_add(). """ return self._arg ^ ------------------------------------------------------------ seccomp.pyx:194:19: Cannot convert 'scmp_arg_cmp' to Python object >>> Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: fix a crash when resolve_syscall failsAndy Lutomirski2013-11-121-1/+7
| | | | | Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com> (changed KeyError to ValueError)
* python: Fix a typo in a commentAndy Lutomirski2013-11-081-1/+1
| | | | | Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: Add docstrings for the ERRNO and TRACE actionsAndy Lutomirski2013-11-061-0/+8
| | | | | Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: Remove file object support from ArgAndy Lutomirski2013-10-221-8/+2
| | | | | | | | | | It's still possible to pass file descriptors into the Arg data, but safe uses are already complicated enough that making the user call fileno() themselves seems reasonable. Signed-off-by: Andy Lutomirski <luto@amacapital.net> (corrected the python test cases to take into account the change) Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: Add a docstring for the SyscallFilter constructorAndy Lutomirski2013-10-081-4/+6
| | | | | | | | | Cython doesn't support docstrings for __cinit__. This change will (very slightly) slow down construction, but it makes ipython happer. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: improve the argument comparison documentationPaul Moore2013-10-041-8/+8
| | | | | | Expand on the comments made by Andy Lutomirski. Signed-off-by: Paul Moore <pmoore@redhat.com>
* python: Improve MASKED_EQ docsAndy Lutomirski2013-10-041-1/+1
| | | | | | | It wasn't clear before which datum was the mask and which was the value. Signed-off-by: Andy Lutomirski <luto@amacapital.net> Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: add basic ARM supportPaul Moore2013-03-262-0/+3
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* arch: add basic x32 supportPaul Moore2013-03-262-0/+3
| | | | Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: add syscall resolution functions that take an architecture argumentPaul Moore2013-01-152-7/+27
| | | | | | | | Similar to the existing seccomp_syscall_resolve_name() function, but they work for arbitrary architectures (assuming libseccomp support of course) and not just the native architecture. Signed-off-by: Paul Moore <pmoore@redhat.com>
* tests: fix 16-arch-basic.pyPaul Moore2013-01-151-8/+9
| | | | | | | | | | | | | Fix the following problem: Traceback (most recent call last): File "./16-arch-basic.py", line 47, in <module> ctx = test(args) File "./16-arch-basic.py", line 33, in test if not Arch.system() == Arch.X86: TypeError: descriptor 'system' of 'seccomp.Arch' object needs an argument Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: add an API to query the system's architecturePaul Moore2012-11-262-1/+9
| | | | | | | In C we add seccomp_arch_native(void), in Python we add Arch.system(). Both functions return an architecture token value. Signed-off-by: Paul Moore <pmoore@redhat.com>
* api: add Python bindings via CythonPaul Moore2012-10-015-0/+740
This patch adds Python bindings using Cython, see http://www.cython.org for more information. There are also some minor tweaks to the build macros while we are mucking around in macros.mk; nothing major. Signed-off-by: Paul Moore <pmoore@redhat.com>