chiark / gitweb /
selinux: Don't attempt to load policy in initramfs if it doesn't exist
authorColin Walters <walters@verbum.org>
Fri, 21 Feb 2014 02:29:00 +0000 (03:29 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Feb 2014 02:30:18 +0000 (03:30 +0100)
commit37f78db2f4a33474fc349f406b0a0a48e9c573a2
tree9dccace64bf1c211d0dac096baa2675936d3d3d8
parentfdc8509fb61965698b7a54e3d0ac094650f21cad
selinux: Don't attempt to load policy in initramfs if it doesn't exist

Currently on at least Fedora, SELinux policy does not come in the
initramfs.  systemd will attempt to load *both* in the initramfs and
in the real root.

Now, the selinux_init_load_policy() API has a regular error return
value, as well as an "enforcing" boolean.  To determine enforcing
state, it looks for /etc/selinux/config as well as the presence of
"enforcing=" on the kernel command line.

Ordinarily, neither of those exist in the initramfs, so it will return
"unknown" for enforcing, and systemd will simply ignore the failure to
load policy.
src/core/selinux-setup.c