selinux-refpolicy/support
Richard Haines 037ac427f8 Ensure correct monolithic binary policy is loaded
When building a monolithic policy with 'make load', the
selinux_config(5) file 'SELINUXTYPE' entry determines what policy
is loaded as load_policy(8) does not take a path value (it always loads
the active system policy as defined by /etc/selinux/config).

Currently it is possible to load the wrong binary policy, for example if
the Reference Policy source is located at:
/etc/selinux/refpolicy
and the /etc/selinux/config file has the following entry:
SELINUXTYPE=targeted
Then the /etc/selinux/targeted/policy/policy.<ver> is loaded when
'make load' is executed.
Resolve this by using selinux_binary_policy_path(3) to determine the
current configured policy name and its location.

Another example is that if the Reference Policy source is located at:
/tmp/custom-rootfs/etc/selinux/refpolicy
and the /etc/selinux/config file has the following entry:
SELINUXTYPE=refpolicy
Then the /etc/selinux/refpolicy/policy/policy.<ver> is loaded when
'make DESTDIR=/tmp/custom-rootfs load' is executed (not the
/tmp/custom-rootfs/etc/selinux/refpolicy/policy/policy.<ver> that the
developer thought would be loaded).
Resolve this by checking if DESTDIR has been set.

Remove the '@touch $(tmpdir)/load' line as the file is never referenced.

Signed-off-by: Richard Haines <richard_c_haines@btinternet.com>
2021-01-13 09:54:48 -05:00
..
comment_move_decl.sed Move user definitions to the right place during compilation. 2020-07-16 10:52:39 -04:00
divert.m4 Fix infrastructure to expand macros in initrc_context when installing. 2009-08-10 14:00:34 -04:00
fatal_error.m4 m4 errprint: add __program__ info 2017-03-08 17:16:27 +01:00
fc_sort.py Correct some misspellings 2020-06-05 15:38:43 +02:00
genclassperms.py Correct some misspellings 2020-06-05 15:38:43 +02:00
genhomedircon.py Correct some misspellings 2020-06-05 15:38:43 +02:00
gennetfilter.py gennetfilter: add rules for ICMP/ICMPv6 packets 2020-04-22 17:03:28 +03:00
gentemplates.sh Add gentemplates.sh to extract template content 2018-06-10 13:23:01 -04:00
get_type_attr_decl.sed Move role declarations to the top of base.conf 2012-02-29 12:08:22 -05:00
iferror.m4
Makefile.devel Fix find commands in Makefiles 2019-05-22 09:00:23 +02:00
policyvers.py fix travis and genhomedircon 2017-03-18 18:38:20 +01:00
pyplate.py Use raw strings in regular expressions 2017-04-08 12:29:07 +02:00
sedoctool.py Correct some misspellings 2020-06-05 15:38:43 +02:00
segenxml.py Fix several misspellings 2020-08-13 14:08:58 +02:00
selinux_binary_policy_path.py Ensure correct monolithic binary policy is loaded 2021-01-13 09:54:48 -05:00
selinux-policy-refpolicy.spec Switch all remaining Python references to the Python 3 interpreter. 2018-05-31 17:41:59 -04:00
selinux-refpolicy-sources.spec.skel Switch all remaining Python references to the Python 3 interpreter. 2018-05-31 17:41:59 -04:00
set_bools_tuns.awk remove trailing whitespaces 2016-12-06 13:45:13 +01:00
undivert.m4 Fix infrastructure to expand macros in initrc_context when installing. 2009-08-10 14:00:34 -04:00
vagrant-vm.cil Vagrant: allow VirtualBox provisionning to use dhclient and ip 2020-01-12 22:45:18 +01:00