diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-07-28 16:59:57 +0200 |
---|---|---|
committer | Topi Miettinen <topimiettinen@users.noreply.github.com> | 2021-11-20 16:38:03 +0000 |
commit | 6fbb33f63120b798455290d96d620464e78712e7 (patch) | |
tree | bef9111964ecb6249a44939510c57d098fb33247 | |
parent | f0804759cf168b201347ce8aa2faefa17376191c (diff) | |
download | systemd-6fbb33f63120b798455290d96d620464e78712e7.tar.gz |
selinux: improve debug log format
path might be NULL when checking against the system permissions, so wrap
with strna().
The command line might not be available over D-Bus and thus cl might be
empty. Print "n/a" instead of the empty string.
-rw-r--r-- | src/core/selinux-access.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c index f6d4e7cc50..6afc64a7b1 100644 --- a/src/core/selinux-access.c +++ b/src/core/selinux-access.c @@ -280,7 +280,7 @@ int mac_selinux_generic_access_check( log_full_errno_zerook(LOG_DEBUG, r, "SELinux access check scon=%s tcon=%s tclass=%s perm=%s state=%s function=%s path=%s cmdline=%s: %m", - scon, fcon, tclass, permission, enforce ? "enforcing" : "permissive", function, path, cl); + scon, fcon, tclass, permission, enforce ? "enforcing" : "permissive", function, strna(path), isempty(cl) ? "n/a" : cl); return enforce ? r : 0; } |