]> git.ipfire.org Git - thirdparty/systemd.git/commit
selinux: early exit in mac_selinux_maybe_reload if not initialized
authorChristian Göttsche <cgzones@googlemail.com>
Sat, 5 Sep 2020 15:49:48 +0000 (17:49 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sat, 5 Sep 2020 19:39:12 +0000 (21:39 +0200)
commit1006038cf103f11ce50fe27ae8f7ee2a3badb05b
treefcd5b992ca4ddfadf6361f491d18578f48e54475
parent22c2f841db7b5cd8885a24a72bc08f77a10264e2
selinux: early exit in mac_selinux_maybe_reload if not initialized

Binaries might not initialize SELinux, e.g. when they normally do not
create files with the SELinux default context.
If they, via an internal libary function, call a _label() function,
mac_selinux_maybe_reload() gets called. Since the SELinux status page
has not been opened, selinux_status_updated() will fail with EINVAL.

This affects particularly test binaries.

Just exit early and avoid confusing debug logs.
src/basic/selinux-util.c