4bff0a
From 7b87977aaa9017c7307cc0645c019b9abd4654d6 Mon Sep 17 00:00:00 2001
4bff0a
From: Jan Synacek <jsynacek@redhat.com>
4bff0a
Date: Thu, 2 May 2019 14:08:39 +0200
4bff0a
Subject: [PATCH] Revert "journal: remove journal audit socket"
4bff0a
4bff0a
This reverts commit 8618ef2fb30b4139c9bec4e45fb499cd8192a87f.
4bff0a
4bff0a
Resolves: #1699287
4bff0a
---
4bff0a
 units/meson.build                   |  2 ++
4bff0a
 units/systemd-journald-audit.socket | 22 ++++++++++++++++++++++
4bff0a
 units/systemd-journald.service.in   |  4 ++--
4bff0a
 3 files changed, 26 insertions(+), 2 deletions(-)
4bff0a
 create mode 100644 units/systemd-journald-audit.socket
4bff0a
4bff0a
diff --git a/units/meson.build b/units/meson.build
4bff0a
index e54a84ccbf..e4ac6ced64 100644
4bff0a
--- a/units/meson.build
4bff0a
+++ b/units/meson.build
4bff0a
@@ -89,6 +89,8 @@ units = [
4bff0a
          'sockets.target.wants/'],
4bff0a
         ['systemd-journal-gatewayd.socket',     'ENABLE_REMOTE HAVE_MICROHTTPD'],
4bff0a
         ['systemd-journal-remote.socket',       'ENABLE_REMOTE HAVE_MICROHTTPD'],
4bff0a
+        ['systemd-journald-audit.socket',       '',
4bff0a
+         'sockets.target.wants/'],
4bff0a
         ['systemd-journald-dev-log.socket',     '',
4bff0a
          'sockets.target.wants/'],
4bff0a
         ['systemd-journald.socket',             '',
4bff0a
diff --git a/units/systemd-journald-audit.socket b/units/systemd-journald-audit.socket
4bff0a
new file mode 100644
4bff0a
index 0000000000..cb8b774963
4bff0a
--- /dev/null
4bff0a
+++ b/units/systemd-journald-audit.socket
4bff0a
@@ -0,0 +1,22 @@
4bff0a
+#  SPDX-License-Identifier: LGPL-2.1+
4bff0a
+#
4bff0a
+#  This file is part of systemd.
4bff0a
+#
4bff0a
+#  systemd is free software; you can redistribute it and/or modify it
4bff0a
+#  under the terms of the GNU Lesser General Public License as published by
4bff0a
+#  the Free Software Foundation; either version 2.1 of the License, or
4bff0a
+#  (at your option) any later version.
4bff0a
+
4bff0a
+[Unit]
4bff0a
+Description=Journal Audit Socket
4bff0a
+Documentation=man:systemd-journald.service(8) man:journald.conf(5)
4bff0a
+DefaultDependencies=no
4bff0a
+Before=sockets.target
4bff0a
+ConditionSecurity=audit
4bff0a
+ConditionCapability=CAP_AUDIT_READ
4bff0a
+
4bff0a
+[Socket]
4bff0a
+Service=systemd-journald.service
4bff0a
+ReceiveBuffer=128M
4bff0a
+ListenNetlink=audit 1
4bff0a
+PassCredentials=yes
4bff0a
diff --git a/units/systemd-journald.service.in b/units/systemd-journald.service.in
4bff0a
index 2d5fd0120d..4eab2fa841 100644
4bff0a
--- a/units/systemd-journald.service.in
4bff0a
+++ b/units/systemd-journald.service.in
4bff0a
@@ -12,12 +12,12 @@ Description=Journal Service
4bff0a
 Documentation=man:systemd-journald.service(8) man:journald.conf(5)
4bff0a
 DefaultDependencies=no
4bff0a
 Requires=systemd-journald.socket
4bff0a
-After=systemd-journald.socket systemd-journald-dev-log.socket syslog.socket
4bff0a
+After=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket syslog.socket
4bff0a
 Before=sysinit.target
4bff0a
 
4bff0a
 [Service]
4bff0a
 Type=notify
4bff0a
-Sockets=systemd-journald.socket systemd-journald-dev-log.socket
4bff0a
+Sockets=systemd-journald.socket systemd-journald-dev-log.socket systemd-journald-audit.socket
4bff0a
 ExecStart=@rootlibexecdir@/systemd-journald
4bff0a
 Restart=always
4bff0a
 RestartSec=0