summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-20 21:48:26 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-06-20 23:03:58 -0400
commitfdcd37df3b97abc381c7b7a29b81cc013c7a3230 (patch)
treee9b2dac5c23060e331fc9c57524758b841367654 /src/shared
parent968f319679d9069af037240d0c3bcd126181cdac (diff)
Make sure we only show authentic coredump messages
Before we only checked the MESSAGE_ID and COREDUMP_UNIT. Those are both user-controlled fields. For COREDUMP_USER_UNIT, relax the rules a bit, and also allow messages from _UID=0.
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/logs-show.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index 89f67f52c0..7240f33590 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -927,8 +927,8 @@ int add_matches_for_unit(sd_journal *j, const char *unit) {
/* Look for coredumps of the service */
(r = sd_journal_add_disjunction(j)) ||
- (r = sd_journal_add_match(j,
- "MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1", 0)) ||
+ (r = sd_journal_add_match(j, "MESSAGE_ID=fc2e22bc6ee647b6b90729ab34a250b1", 0)) ||
+ (r = sd_journal_add_match(j, "_UID=0", 0)) ||
(r = sd_journal_add_match(j, m2, 0)) ||
/* Look for messages from PID 1 about this service */
@@ -965,7 +965,8 @@ int add_matches_for_user_unit(sd_journal *j, const char *unit, uid_t uid) {
/* Look for coredumps of the service */
(r = sd_journal_add_disjunction(j)) ||
(r = sd_journal_add_match(j, m3, 0)) ||
- (r = sd_journal_add_match(j, m4, 0))
+ (r = sd_journal_add_match(j, m4, 0)) ||
+ (r = sd_journal_add_match(j, "_UID=0", 0))
);
return r;
}