selinux: delay mac_selinux_enforcing call after SELinux was determined to be enabled
authorChristian Göttsche <cgzones@googlemail.com>
Tue, 17 Mar 2020 17:11:14 +0000 (18:11 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 19 Mar 2020 07:56:30 +0000 (08:56 +0100)
commit194fe32296b5079cf4edcffbe15f672ff8a9e762
tree07888b155d36c49f1f1f8faf91a1f703e7fe5f20
parentcc46b9d91399aed39eb64fa07283e40eb8262078
selinux: delay mac_selinux_enforcing call after SELinux was determined to be enabled

Calling `mac_selinux_enforcing()`, which calls `security_getenforce()`, on a SELinux disabled system causes the following error message to be printed:
    Failed to get SELinux enforced status: No such file or directory

Fixes: 257188f80ce1a083e3a88b679b898a73fecab53b ("selinux: cache enforced status and treat retrieve failure as enforced mode")
Supersedes: #15145
src/core/selinux-access.c