Use python libselinux bindings to determine policy version.

This eliminates the hardcoded /selinux in Rules.monolithic, which
broke when the filesystem mount was moved to /sys/fs/selinux.
This commit is contained in:
Chris PeBenito 2013-06-06 09:27:40 -04:00
parent 7e95a88171
commit 3bf7fd504c
3 changed files with 5 additions and 1 deletions

View File

@ -97,6 +97,7 @@ support := support
genxml := $(PYTHON) -E $(support)/segenxml.py
gendoc := $(PYTHON) -E $(support)/sedoctool.py
genperm := $(PYTHON) -E $(support)/genclassperms.py
policyvers := $(PYTHON) -E $(support)/policyvers.py
fcsort := $(tmpdir)/fc_sort
setbools := $(AWK) -f $(support)/set_bools_tuns.awk
get_type_attr_decl := $(SED) -r -f $(support)/get_type_attr_decl.sed

View File

@ -5,7 +5,7 @@
# determine the policy version and current kernel version if possible
pv := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
kv := $(shell cat /selinux/policyvers)
kv := $(shell $(policyvers))
# dont print version warnings if we are unable to determine
# the currently running kernel's policy version

3
support/policyvers.py Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/python
import selinux
print selinux.security_policyvers()