[PATCH SYSTEMD 2/7] selinux: improve debug log format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.  To improve readability quote the corresponding value.
---
 src/core/selinux-access.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index e8e73a5951..e40fd937a6 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -279,8 +279,8 @@ 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 func=%s path=%s cmdline=%s: %m",
-                              scon, fcon, tclass, permission, enforce ? "enforcing" : "permissive", func, path, cl);
+                              "SELinux access check scon=%s tcon=%s tclass=%s perm=%s state=%s func=%s path=%s cmdline='%s': %m",
+                              scon, fcon, tclass, permission, enforce ? "enforcing" : "permissive", func, strna(path), cl);
         return enforce ? r : 0;
 }
 
-- 
2.32.0




[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux