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.
This commit is contained in:
Christian Göttsche
2021-11-20 16:38:03 +00:00
committed by Topi Miettinen
parent f0804759cf
commit 6fbb33f631
+1 -1
View File
@@ -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;
}