selinux/python/audit2allow
Christian Göttsche 4613038d8e sepolgen-ifgen: refactor default policy path retrieval
On a SELinux disabled system the python call
`selinux.security_policyvers()` will fail.

Move the logic to find a binary policy from the python script
`sepolgen-ifgen` to the C-helper `sepolgen-ifgen-attr-helper`.
Change the helper command line interface to accept an optional policy
path as second argument.  If not given try the current loaded policy
(`selinux_current_policy_path`) and if running on a SELinux disabled
system iterate over the default store path appending policy versions
starting at the maximum supported policy version
(`sepol_policy_kern_vers_max`).

This changes the helper command line interface from:
    sepolgen-ifgen-attr-helper policy_file out_file
to
    sepolgen-ifgen-attr-helper out_file [policy_file]
and adds a linkage to libselinux.

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
2020-06-18 19:32:07 +02:00
..
ru Add man pages translation by Olesya Gerasimenko 2019-01-28 12:03:57 +01:00
.gitignore python/audit2allow: make the tests useful again 2019-01-08 10:15:46 +01:00
audit2allow python: always use python3 in the shebang of programs using setools 2019-02-17 22:34:50 +01:00
audit2allow.1 python: add xperms support to audit2allow 2018-06-16 10:36:14 +02:00
audit2why
audit2why.1
Makefile sepolgen-ifgen: refactor default policy path retrieval 2020-06-18 19:32:07 +02:00
sepolgen-ifgen sepolgen-ifgen: refactor default policy path retrieval 2020-06-18 19:32:07 +02:00
sepolgen-ifgen-attr-helper.c sepolgen-ifgen: refactor default policy path retrieval 2020-06-18 19:32:07 +02:00
test_audit2allow.py python/audit2allow: use local sepolgen-ifgen-attr-helper for tests 2019-01-08 10:15:46 +01:00
test_dummy_policy.cil python/audit2allow: make the tests useful again 2019-01-08 10:15:46 +01:00
test.log python: add xperms support to audit2allow 2018-06-16 10:36:14 +02:00