teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From 709ea8522339275193a9cef277f9b86926ba4068 Mon Sep 17 00:00:00 2001
From: Michael Biebl <mbiebl@gmail.com>
Date: Thu, 30 Mar 2017 11:56:25 +0200
Subject: [PATCH] journal: fix up syslog facility when forwarding native
 messages (#5667)

Native journal messages (_TRANSPORT=journal) typically don't have a
syslog facility attached to it. As a result when forwarding the messages
to syslog they ended up with facility 0 (LOG_KERN).
Apply syslog_fixup_facility() so we use LOG_USER instead.

Fixes: #5640(cherry picked from commit b6a20306fa5dbb8129dd09e07efeacfcfc57363f)
---
 src/journal/journald-native.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 3c03b83754..c9bf3832c7 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -279,7 +279,7 @@ void server_process_native_message(
 
         if (message) {
                 if (s->forward_to_syslog)
-                        server_forward_syslog(s, priority, identifier, message, ucred, tv);
+                        server_forward_syslog(s, syslog_fixup_facility(priority), identifier, message, ucred, tv);
 
                 if (s->forward_to_kmsg)
                         server_forward_kmsg(s, priority, identifier, message, ucred);