From: Yu Watanabe Date: Sun, 27 Jul 2025 15:23:21 +0000 (+0900) Subject: journal: check filtering after parsing timestamp, identifier, pid, and so on X-Git-Tag: v258-rc2~61^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c60a16ba8fa2a57af23f7653fd2316c26e06c577;p=thirdparty%2Fsystemd.git journal: check filtering after parsing timestamp, identifier, pid, and so on Otherwise, filtering regex with '^' does not work. Fixes a bug in 87a13dabbd81c2e31fd5ac7b81cce61baf23e59c (v253). Fixes #38361. --- diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c index 8e9c0e2b402..277146d5932 100644 --- a/src/journal/journald-syslog.c +++ b/src/journal/journald-syslog.c @@ -392,9 +392,6 @@ void manager_process_syslog_message( if (!client_context_test_priority(context, priority)) return; - if (client_context_check_keep_log(context, msg, strlen(msg)) <= 0) - return; - syslog_ts = msg; syslog_ts_len = syslog_skip_timestamp(&msg); if (syslog_ts_len == 0) @@ -403,6 +400,9 @@ void manager_process_syslog_message( syslog_parse_identifier(&msg, &identifier, &pid); + if (client_context_check_keep_log(context, msg, strlen(msg)) <= 0) + return; + if (m->config.forward_to_syslog) forward_syslog_raw(m, priority, buf, raw_len, ucred, tv);