]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: check filtering after parsing timestamp, identifier, pid, and so on
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 27 Jul 2025 15:23:21 +0000 (00:23 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 28 Jul 2025 07:29:31 +0000 (16:29 +0900)
Otherwise, filtering regex with '^' does not work.

Fixes a bug in 87a13dabbd81c2e31fd5ac7b81cce61baf23e59c (v253).
Fixes #38361.

src/journal/journald-syslog.c

index 8e9c0e2b402ae32e7d0f4222c567b7790e125f04..277146d5932c93c8d27b1e45b2881d01512a1496 100644 (file)
@@ -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);