From b5931a0218d5f05480c2feb6c5baee93076aa703 Mon Sep 17 00:00:00 2001 From: Benny Baumann Date: Mon, 13 Nov 2023 14:09:50 +0100 Subject: pam_selinux: take null contexts into account As the context variables can be NULL at this point, this has to be reflected when printing them for debug purposes. Signed-off-by: Benny Baumann --- modules/pam_selinux/pam_selinux.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/pam_selinux') diff --git a/modules/pam_selinux/pam_selinux.c b/modules/pam_selinux/pam_selinux.c index 713b3f73..b0123c8f 100644 --- a/modules/pam_selinux/pam_selinux.c +++ b/modules/pam_selinux/pam_selinux.c @@ -114,7 +114,8 @@ send_audit_message(const pam_handle_t *pamh, int success, const char *default_co fallback: #endif /* HAVE_LIBAUDIT */ pam_syslog(pamh, LOG_NOTICE, "pam: default-context=%s selected-context=%s success %d", - default_context, selected_context, success); + default_context ? default_context : "(null)", + selected_context ? selected_context : "(null)", success); #ifdef HAVE_LIBAUDIT cleanup: -- cgit v1.2.3