teknoraver / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone

Blame SOURCES/0068-coredump-remove-duplicate-MESSAGE-prefix-from-messag.patch

ff6046
From af43906bb0c8f2bb3b135d68d56ea2fa58fa9e60 Mon Sep 17 00:00:00 2001
ff6046
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
ff6046
Date: Wed, 5 Dec 2018 17:33:15 +0100
ff6046
Subject: [PATCH] coredump: remove duplicate MESSAGE= prefix from message
ff6046
ff6046
systemd-coredump[9982]: MESSAGE=Process 771 (systemd-journal) of user 0 dumped core.
ff6046
systemd-coredump[9982]: Coredump diverted to /var/lib/systemd/coredump/core...
ff6046
ff6046
log_dispatch() calls log_dispatch_internal() which calls write_to_journal()
ff6046
which appends MESSAGE= on its own.
ff6046
ff6046
(cherry-picked from commit 4f62556d71206ac814a020a954b397d4940e14c3)
ff6046
ff6046
Related: #1664976
ff6046
---
ff6046
 src/coredump/coredump.c | 5 +++--
ff6046
 1 file changed, 3 insertions(+), 2 deletions(-)
ff6046
ff6046
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
ff6046
index 20a1cbdd45..d7dd81c1b4 100644
ff6046
--- a/src/coredump/coredump.c
ff6046
+++ b/src/coredump/coredump.c
ff6046
@@ -789,9 +789,10 @@ log:
ff6046
                 return log_oom();
ff6046
 
ff6046
         if (journald_crash) {
ff6046
-                /* We cannot log to the journal, so just print the MESSAGE.
ff6046
+                /* We cannot log to the journal, so just print the message.
ff6046
                  * The target was set previously to something safe. */
ff6046
-                log_dispatch(LOG_ERR, 0, core_message);
ff6046
+                assert(startswith(core_message, "MESSAGE="));
ff6046
+                log_dispatch(LOG_ERR, 0, core_message + strlen("MESSAGE="));
ff6046
                 return 0;
ff6046
         }
ff6046