]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
coredump: remove duplicate MESSAGE= prefix from message
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 5 Dec 2018 16:33:15 +0000 (17:33 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 9 Jan 2019 22:41:53 +0000 (23:41 +0100)
systemd-coredump[9982]: MESSAGE=Process 771 (systemd-journal) of user 0 dumped core.
systemd-coredump[9982]: Coredump diverted to /var/lib/systemd/coredump/core...

log_dispatch() calls log_dispatch_internal() which calls write_to_journal()
which appends MESSAGE= on its own.

src/coredump/coredump.c

index 0c888b26f9ca158f78c4ef4f6ac229f0050dcb35..20c1fb02471b030ceba95be85adf9e35f82770fe 100644 (file)
@@ -800,9 +800,10 @@ log:
                 return log_oom();
 
         if (journald_crash) {
-                /* We cannot log to the journal, so just print the MESSAGE.
+                /* We cannot log to the journal, so just print the message.
                  * The target was set previously to something safe. */
-                log_dispatch(LOG_ERR, 0, core_message);
+                assert(startswith(core_message, "MESSAGE="));
+                log_dispatch(LOG_ERR, 0, core_message + strlen("MESSAGE="));
                 return 0;
         }