teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0018-journal-fix-up-syslog-facility-when-forwarding-nativ.patch

Zbigniew Jędrzejewski-Szmek f4a676
From 709ea8522339275193a9cef277f9b86926ba4068 Mon Sep 17 00:00:00 2001
Zbigniew Jędrzejewski-Szmek f4a676
From: Michael Biebl <mbiebl@gmail.com>
Zbigniew Jędrzejewski-Szmek f4a676
Date: Thu, 30 Mar 2017 11:56:25 +0200
Zbigniew Jędrzejewski-Szmek f4a676
Subject: [PATCH] journal: fix up syslog facility when forwarding native
Zbigniew Jędrzejewski-Szmek f4a676
 messages (#5667)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Native journal messages (_TRANSPORT=journal) typically don't have a
Zbigniew Jędrzejewski-Szmek f4a676
syslog facility attached to it. As a result when forwarding the messages
Zbigniew Jędrzejewski-Szmek f4a676
to syslog they ended up with facility 0 (LOG_KERN).
Zbigniew Jędrzejewski-Szmek f4a676
Apply syslog_fixup_facility() so we use LOG_USER instead.
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
Fixes: #5640(cherry picked from commit b6a20306fa5dbb8129dd09e07efeacfcfc57363f)
Zbigniew Jędrzejewski-Szmek f4a676
---
Zbigniew Jędrzejewski-Szmek f4a676
 src/journal/journald-native.c | 2 +-
Zbigniew Jędrzejewski-Szmek f4a676
 1 file changed, 1 insertion(+), 1 deletion(-)
Zbigniew Jędrzejewski-Szmek f4a676
Zbigniew Jędrzejewski-Szmek f4a676
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
Zbigniew Jędrzejewski-Szmek f4a676
index 3c03b83754..c9bf3832c7 100644
Zbigniew Jędrzejewski-Szmek f4a676
--- a/src/journal/journald-native.c
Zbigniew Jędrzejewski-Szmek f4a676
+++ b/src/journal/journald-native.c
Zbigniew Jędrzejewski-Szmek f4a676
@@ -279,7 +279,7 @@ void server_process_native_message(
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
         if (message) {
Zbigniew Jędrzejewski-Szmek f4a676
                 if (s->forward_to_syslog)
Zbigniew Jędrzejewski-Szmek f4a676
-                        server_forward_syslog(s, priority, identifier, message, ucred, tv);
Zbigniew Jędrzejewski-Szmek f4a676
+                        server_forward_syslog(s, syslog_fixup_facility(priority), identifier, message, ucred, tv);
Zbigniew Jędrzejewski-Szmek f4a676
 
Zbigniew Jędrzejewski-Szmek f4a676
                 if (s->forward_to_kmsg)
Zbigniew Jędrzejewski-Szmek f4a676
                         server_forward_kmsg(s, priority, identifier, message, ucred);