initd/init: add minimal SELinux policy loading support master
authorThomas Petazzoni <thomas.petazzoni at bootlin.com>
Mon, 10 Aug 2020 01:15:20 +0000 (15:15 -1000)
committerDaniel Golle <daniel@makrotopia.org>
Mon, 10 Aug 2020 08:35:03 +0000 (09:35 +0100)
commitfad899769e1411cc273785461f073a0f7931b9a0
tree459709b370c36dd1be5efce9d22ef157bcbdcc55
parentab55357dfe5bd0edac0b9556a83e69814df791b1
initd/init: add minimal SELinux policy loading support

In order to support SELinux in OpenWrt, this commit introduces minimal
support for loading the SELinux policy in the init code. The logic is
very much inspired from what Busybox is doing: call
selinux_init_load_policy() from libselinux, and then re-execute init
so that it runs with the SELinux policy in place and enforced.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni at bootlin.com>
[fix spelling of OpenWrt]
Signed-off-by: Paul Spooren <mail@aparcar.org>
CMakeLists.txt
initd/init.c