diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0028-journal-do-not-remove-multiple-spaces-after-identifi.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0028-journal-do-not-remove-multiple-spaces-after-identifi.patch | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/meta/recipes-core/systemd/systemd/0028-journal-do-not-remove-multiple-spaces-after-identifi.patch b/meta/recipes-core/systemd/systemd/0028-journal-do-not-remove-multiple-spaces-after-identifi.patch deleted file mode 100644 index fa2c01034b..0000000000 --- a/meta/recipes-core/systemd/systemd/0028-journal-do-not-remove-multiple-spaces-after-identifi.patch +++ /dev/null | |||
@@ -1,84 +0,0 @@ | |||
1 | From c3a7da1bbb6d2df8ab7ea1c7ce34ded37a21959f Mon Sep 17 00:00:00 2001 | ||
2 | From: Yu Watanabe <watanabe.yu+github@gmail.com> | ||
3 | Date: Fri, 10 Aug 2018 11:07:54 +0900 | ||
4 | Subject: [PATCH] journal: do not remove multiple spaces after identifier in | ||
5 | syslog message | ||
6 | |||
7 | Single space is used as separator. | ||
8 | C.f. discussions in #156. | ||
9 | |||
10 | Fixes #9839 introduced by a6aadf4ae0bae185dc4c414d492a4a781c80ffe5. | ||
11 | |||
12 | Patch backported from systemd master at | ||
13 | 8595102d3ddde6d25c282f965573a6de34ab4421. | ||
14 | |||
15 | This matches the change done for systemd-journald, hence forming the second | ||
16 | part of the fix for CVE-2018-16866 | ||
17 | --- | ||
18 | src/journal/journald-syslog.c | 4 +++- | ||
19 | src/journal/test-journal-syslog.c | 24 ++++++++++++++---------- | ||
20 | 2 files changed, 17 insertions(+), 11 deletions(-) | ||
21 | |||
22 | diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c | ||
23 | index 97711ac7a3..e0b55cc566 100644 | ||
24 | --- a/src/journal/journald-syslog.c | ||
25 | +++ b/src/journal/journald-syslog.c | ||
26 | @@ -219,7 +219,9 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid) | ||
27 | if (t) | ||
28 | *identifier = t; | ||
29 | |||
30 | - e += strspn(p + e, WHITESPACE); | ||
31 | + /* Single space is used as separator */ | ||
32 | + if (p[e] != '\0' && strchr(WHITESPACE, p[e])) | ||
33 | + e++; | ||
34 | |||
35 | *buf = p + e; | ||
36 | return e; | ||
37 | diff --git a/src/journal/test-journal-syslog.c b/src/journal/test-journal-syslog.c | ||
38 | index 05f759817e..7294cde032 100644 | ||
39 | --- a/src/journal/test-journal-syslog.c | ||
40 | +++ b/src/journal/test-journal-syslog.c | ||
41 | @@ -6,7 +6,7 @@ | ||
42 | #include "string-util.h" | ||
43 | |||
44 | static void test_syslog_parse_identifier(const char *str, | ||
45 | - const char *ident, const char *pid, int ret) { | ||
46 | + const char *ident, const char *pid, const char *rest, int ret) { | ||
47 | const char *buf = str; | ||
48 | _cleanup_free_ char *ident2 = NULL, *pid2 = NULL; | ||
49 | int ret2; | ||
50 | @@ -16,18 +16,22 @@ static void test_syslog_parse_identifier(const char *str, | ||
51 | assert_se(ret == ret2); | ||
52 | assert_se(ident == ident2 || streq_ptr(ident, ident2)); | ||
53 | assert_se(pid == pid2 || streq_ptr(pid, pid2)); | ||
54 | + assert_se(streq(buf, rest)); | ||
55 | } | ||
56 | |||
57 | int main(void) { | ||
58 | - test_syslog_parse_identifier("pidu[111]: xxx", "pidu", "111", 11); | ||
59 | - test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, 6); | ||
60 | - test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, 7); | ||
61 | - test_syslog_parse_identifier("pidu xxx", NULL, NULL, 0); | ||
62 | - test_syslog_parse_identifier(":", "", NULL, 1); | ||
63 | - test_syslog_parse_identifier(": ", "", NULL, 3); | ||
64 | - test_syslog_parse_identifier("pidu:", "pidu", NULL, 5); | ||
65 | - test_syslog_parse_identifier("pidu: ", "pidu", NULL, 6); | ||
66 | - test_syslog_parse_identifier("pidu : ", NULL, NULL, 0); | ||
67 | + test_syslog_parse_identifier("pidu[111]: xxx", "pidu", "111", "xxx", 11); | ||
68 | + test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, "xxx", 6); | ||
69 | + test_syslog_parse_identifier("pidu: xxx", "pidu", NULL, " xxx", 6); | ||
70 | + test_syslog_parse_identifier("pidu xxx", NULL, NULL, "pidu xxx", 0); | ||
71 | + test_syslog_parse_identifier(" pidu xxx", NULL, NULL, " pidu xxx", 0); | ||
72 | + test_syslog_parse_identifier("", NULL, NULL, "", 0); | ||
73 | + test_syslog_parse_identifier(" ", NULL, NULL, " ", 0); | ||
74 | + test_syslog_parse_identifier(":", "", NULL, "", 1); | ||
75 | + test_syslog_parse_identifier(": ", "", NULL, " ", 2); | ||
76 | + test_syslog_parse_identifier("pidu:", "pidu", NULL, "", 5); | ||
77 | + test_syslog_parse_identifier("pidu: ", "pidu", NULL, "", 6); | ||
78 | + test_syslog_parse_identifier("pidu : ", NULL, NULL, "pidu : ", 0); | ||
79 | |||
80 | return 0; | ||
81 | } | ||
82 | -- | ||
83 | 2.11.0 | ||
84 | |||