mirror of
https://github.com/SELinuxProject/refpolicy
synced 2025-04-01 22:58:20 +00:00
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:
parent
7e95a88171
commit
3bf7fd504c
1
Makefile
1
Makefile
@ -97,6 +97,7 @@ support := support
|
|||||||
genxml := $(PYTHON) -E $(support)/segenxml.py
|
genxml := $(PYTHON) -E $(support)/segenxml.py
|
||||||
gendoc := $(PYTHON) -E $(support)/sedoctool.py
|
gendoc := $(PYTHON) -E $(support)/sedoctool.py
|
||||||
genperm := $(PYTHON) -E $(support)/genclassperms.py
|
genperm := $(PYTHON) -E $(support)/genclassperms.py
|
||||||
|
policyvers := $(PYTHON) -E $(support)/policyvers.py
|
||||||
fcsort := $(tmpdir)/fc_sort
|
fcsort := $(tmpdir)/fc_sort
|
||||||
setbools := $(AWK) -f $(support)/set_bools_tuns.awk
|
setbools := $(AWK) -f $(support)/set_bools_tuns.awk
|
||||||
get_type_attr_decl := $(SED) -r -f $(support)/get_type_attr_decl.sed
|
get_type_attr_decl := $(SED) -r -f $(support)/get_type_attr_decl.sed
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
# determine the policy version and current kernel version if possible
|
# determine the policy version and current kernel version if possible
|
||||||
pv := $(shell $(CHECKPOLICY) -V |cut -f 1 -d ' ')
|
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
|
# dont print version warnings if we are unable to determine
|
||||||
# the currently running kernel's policy version
|
# the currently running kernel's policy version
|
||||||
|
3
support/policyvers.py
Normal file
3
support/policyvers.py
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/usr/bin/python
|
||||||
|
import selinux
|
||||||
|
print selinux.security_policyvers()
|
Loading…
Reference in New Issue
Block a user