]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
selinux-util: increase log severity
authorChristian Göttsche <cgzones@googlemail.com>
Wed, 18 Dec 2019 13:56:54 +0000 (14:56 +0100)
committerChristian Göttsche <cgzones@googlemail.com>
Tue, 4 Feb 2020 17:11:42 +0000 (18:11 +0100)
`log_enforcing()` and `log_enforcing_errno()` are only used for important messages, which describe failures in enforced mode.
They are guarded either by `!mac_selinux_use()` or `!label_hnd` checks, where the latter is itself guarded by the former.
Only SELinux enabled systems print these logs.
This helps to configure a system in permissive mode, without getting surprising failures when switching to enforced mode.

src/basic/selinux-util.c

index 2c6d407295b5a308bd194f3440e05ea6fe703394..1d209d03d56ea57fbeb3a793c881a65397522a77 100644 (file)
@@ -37,8 +37,8 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(context_t, context_free);
 static int cached_use = -1;
 static struct selabel_handle *label_hnd = NULL;
 
-#define log_enforcing(...) log_full(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG, __VA_ARGS__)
-#define log_enforcing_errno(r, ...) log_full_errno(security_getenforce() == 1 ? LOG_ERR : LOG_DEBUG, r, __VA_ARGS__)
+#define log_enforcing(...) log_full(security_getenforce() == 1 ? LOG_ERR : LOG_WARNING, __VA_ARGS__)
+#define log_enforcing_errno(r, ...) log_full_errno(security_getenforce() == 1 ? LOG_ERR : LOG_WARNING, r, __VA_ARGS__)
 #endif
 
 bool mac_selinux_use(void) {