ryantimwilson / rpms / systemd

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