teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame SOURCES/0214-journald-handle-more-gracefully-when-bind-fails-on-a.patch

803fb7
From a81ba5e1bfabf643e11fec41c1ce646874ae0df1 Mon Sep 17 00:00:00 2001
803fb7
From: Lennart Poettering <lennart@poettering.net>
803fb7
Date: Wed, 20 May 2015 14:37:21 +0200
803fb7
Subject: [PATCH] journald: handle more gracefully when bind() fails on audit
803fb7
 sockets
803fb7
803fb7
(cherry picked from commit 417a7fdc418ec76cc4c321c9a07ec15c72b3ac7d)
803fb7
803fb7
Cherry-picked from: 417a7fd
803fb7
Resolves: #1222517
803fb7
---
803fb7
 src/journal/journald-audit.c | 11 ++++++++---
803fb7
 1 file changed, 8 insertions(+), 3 deletions(-)
803fb7
803fb7
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
803fb7
index 46eb82fa3..0e739a23a 100644
803fb7
--- a/src/journal/journald-audit.c
803fb7
+++ b/src/journal/journald-audit.c
803fb7
@@ -532,9 +532,14 @@ int server_open_audit(Server *s) {
803fb7
                         return 0;
803fb7
                 }
803fb7
 
803fb7
-                r = bind(s->audit_fd, &sa.sa, sizeof(sa.nl));
803fb7
-                if (r < 0)
803fb7
-                        return log_error_errno(errno, "Failed to join audit multicast group: %m");
803fb7
+                if (bind(s->audit_fd, &sa.sa, sizeof(sa.nl)) < 0) {
803fb7
+                        log_warning_errno(errno,
803fb7
+                                          "Failed to join audit multicast group. "
803fb7
+                                          "The kernel is probably too old or multicast reading is not supported. "
803fb7
+                                          "Ignoring: %m");
803fb7
+                        s->audit_fd = safe_close(s->audit_fd);
803fb7
+                        return 0;
803fb7
+                }
803fb7
         } else
803fb7
                 fd_nonblock(s->audit_fd, 1);
803fb7