Blame SOURCES/pam-1.3.1-audit-error.patch

784d46
From b429ea18b1c9c8953df5169c6a453b4255a6f23d Mon Sep 17 00:00:00 2001
784d46
From: Iker Pedrosa <ikerpedrosam@gmail.com>
784d46
Date: Thu, 27 Feb 2020 11:48:47 +0100
784d46
Subject: [PATCH] pam_tty_audit: if kernel audit is disabled return PAM_IGNORE
784d46
784d46
If kernel audit is disabled the socket open will return
784d46
EPROTONOSUPPORT.
784d46
Return PAM_IGNORE from pam_tty_audit and log a warning
784d46
in this situation so login is not blocked by the module.
784d46
---
784d46
 modules/pam_tty_audit/pam_tty_audit.c | 8 ++++++++
784d46
 1 file changed, 8 insertions(+)
784d46
784d46
diff --git a/modules/pam_tty_audit/pam_tty_audit.c b/modules/pam_tty_audit/pam_tty_audit.c
784d46
index 7dbcada2..589c60a2 100644
784d46
--- a/modules/pam_tty_audit/pam_tty_audit.c
784d46
+++ b/modules/pam_tty_audit/pam_tty_audit.c
784d46
@@ -351,6 +351,14 @@ pam_sm_open_session (pam_handle_t *pamh, int flags, int argc, const char **argv)
784d46
 
784d46
   fd = nl_open ();
784d46
   if (fd == -1
784d46
+      && errno == EPROTONOSUPPORT)
784d46
+    {
784d46
+      pam_syslog (pamh, LOG_WARNING, "unable to open audit socket, audit not "
784d46
+                  "supported; tty_audit skipped");
784d46
+      free (old_status);
784d46
+      return PAM_IGNORE;
784d46
+    }
784d46
+  else if (fd == -1
784d46
       || nl_send (fd, AUDIT_TTY_GET, 0, NULL, 0) != 0
784d46
       || nl_recv (fd, AUDIT_TTY_GET, old_status, sizeof (*old_status)) != 0)
784d46
     {
784d46
-- 
784d46
2.25.2
784d46