Gentoo Archives: gentoo-commits

From: Mike Gilbert <floppym@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/systemd/, sys-apps/systemd/files/
Date: Sun, 11 Aug 2019 16:28:13
Message-Id: 1565540861.35dcfcc83b7e325672f9167b5417d67deb4e3270.floppym@gentoo
1 commit: 35dcfcc83b7e325672f9167b5417d67deb4e3270
2 Author: Mike Gilbert <floppym <AT> gentoo <DOT> org>
3 AuthorDate: Sun Aug 11 16:27:41 2019 +0000
4 Commit: Mike Gilbert <floppym <AT> gentoo <DOT> org>
5 CommitDate: Sun Aug 11 16:27:41 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35dcfcc8
7
8 sys-apps/systemd: backport fixes
9
10 Closes: https://bugs.gentoo.org/691232
11 Closes: https://bugs.gentoo.org/691280
12 Closes: https://bugs.gentoo.org/691502
13 Package-Manager: Portage-2.3.71, Repoman-2.3.16_p24
14 Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>
15
16 sys-apps/systemd/files/243-rc1-cryptsetup.patch | 148 +++++++++++++++++++++
17 ...243-rc1-revert-logind-remove-unused-check.patch | 31 +++++
18 .../systemd/files/243-rc1-udev-properties.patch | 53 ++++++++
19 ...243_rc1-r1.ebuild => systemd-243_rc1-r2.ebuild} | 3 +
20 4 files changed, 235 insertions(+)
21
22 diff --git a/sys-apps/systemd/files/243-rc1-cryptsetup.patch b/sys-apps/systemd/files/243-rc1-cryptsetup.patch
23 new file mode 100644
24 index 00000000000..e922d4d29cb
25 --- /dev/null
26 +++ b/sys-apps/systemd/files/243-rc1-cryptsetup.patch
27 @@ -0,0 +1,148 @@
28 +From f4ea8432e67110b73b07dd0e47a5339d83b350fb Mon Sep 17 00:00:00 2001
29 +From: Lennart Poettering <lennart@××××××××××.net>
30 +Date: Wed, 31 Jul 2019 09:38:15 +0200
31 +Subject: [PATCH] cryptsetup-generator: fix coverity issue
32 +
33 +Fixes coverity issue 1403772
34 +---
35 + src/cryptsetup/cryptsetup-generator.c | 16 ++++++++--------
36 + 1 file changed, 8 insertions(+), 8 deletions(-)
37 +
38 +diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
39 +index c51bb9ae189..960f4762b7d 100644
40 +--- a/src/cryptsetup/cryptsetup-generator.c
41 ++++ b/src/cryptsetup/cryptsetup-generator.c
42 +@@ -46,30 +46,30 @@ STATIC_DESTRUCTOR_REGISTER(arg_disks, hashmap_freep);
43 + STATIC_DESTRUCTOR_REGISTER(arg_default_options, freep);
44 + STATIC_DESTRUCTOR_REGISTER(arg_default_keyfile, freep);
45 +
46 +-static int split_keyspec(const char *keyspec, char **keyfile, char **keydev) {
47 ++static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
48 + _cleanup_free_ char *kfile = NULL, *kdev = NULL;
49 +- char *c;
50 ++ const char *c;
51 +
52 + assert(keyspec);
53 +- assert(keyfile);
54 +- assert(keydev);
55 ++ assert(ret_keyfile);
56 ++ assert(ret_keydev);
57 +
58 + c = strrchr(keyspec, ':');
59 + if (c) {
60 + kfile = strndup(keyspec, c-keyspec);
61 + kdev = strdup(c + 1);
62 +- if (!*kfile || !*kdev)
63 ++ if (!kfile || !kdev)
64 + return log_oom();
65 + } else {
66 + /* No keydev specified */
67 + kfile = strdup(keyspec);
68 + kdev = NULL;
69 +- if (!*kfile)
70 ++ if (!kfile)
71 + return log_oom();
72 + }
73 +
74 +- *keyfile = TAKE_PTR(kfile);
75 +- *keydev = TAKE_PTR(kdev);
76 ++ *ret_keyfile = TAKE_PTR(kfile);
77 ++ *ret_keydev = TAKE_PTR(kdev);
78 +
79 + return 0;
80 + }
81 +From 5d2100dc4c32abbce4109e75cbfbbef6e1b2b7b1 Mon Sep 17 00:00:00 2001
82 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
83 +Date: Thu, 1 Aug 2019 08:13:13 +0200
84 +Subject: [PATCH] cryptsetup: use unabbrieviated variable names
85 +
86 +Now that "ret_" has been added to the output variables, we can name
87 +the internal variables without artificial abbrevs.
88 +---
89 + src/cryptsetup/cryptsetup-generator.c | 18 +++++++++---------
90 + 1 file changed, 9 insertions(+), 9 deletions(-)
91 +
92 +diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
93 +index 960f4762b7d..84483143945 100644
94 +--- a/src/cryptsetup/cryptsetup-generator.c
95 ++++ b/src/cryptsetup/cryptsetup-generator.c
96 +@@ -47,7 +47,7 @@ STATIC_DESTRUCTOR_REGISTER(arg_default_options, freep);
97 + STATIC_DESTRUCTOR_REGISTER(arg_default_keyfile, freep);
98 +
99 + static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_keydev) {
100 +- _cleanup_free_ char *kfile = NULL, *kdev = NULL;
101 ++ _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
102 + const char *c;
103 +
104 + assert(keyspec);
105 +@@ -56,20 +56,20 @@ static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_key
106 +
107 + c = strrchr(keyspec, ':');
108 + if (c) {
109 +- kfile = strndup(keyspec, c-keyspec);
110 +- kdev = strdup(c + 1);
111 +- if (!kfile || !kdev)
112 ++ keyfile = strndup(keyspec, c-keyspec);
113 ++ keydev = strdup(c + 1);
114 ++ if (!keyfile || !keydev)
115 + return log_oom();
116 + } else {
117 + /* No keydev specified */
118 +- kfile = strdup(keyspec);
119 +- kdev = NULL;
120 +- if (!kfile)
121 ++ keyfile = strdup(keyspec);
122 ++ keydev = NULL;
123 ++ if (!keyfile)
124 + return log_oom();
125 + }
126 +
127 +- *ret_keyfile = TAKE_PTR(kfile);
128 +- *ret_keydev = TAKE_PTR(kdev);
129 ++ *ret_keyfile = TAKE_PTR(keyfile);
130 ++ *ret_keydev = TAKE_PTR(keydev);
131 +
132 + return 0;
133 + }
134 +From fef716b28be6e866b8afe995805d5ebe2af6bbfa Mon Sep 17 00:00:00 2001
135 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@××××××.pl>
136 +Date: Thu, 1 Aug 2019 08:15:43 +0200
137 +Subject: [PATCH] cryptsetup: don't assert on variable which is optional
138 +
139 +https://github.com/systemd/systemd/commit/50d2eba27b9bfc77ef6b40e5721713846815418b#commitcomment-34519739
140 +
141 +In add_crypttab_devices() split_keyspec is called on the keyfile argument,
142 +which may be NULL.
143 +---
144 + src/cryptsetup/cryptsetup-generator.c | 8 ++++++--
145 + 1 file changed, 6 insertions(+), 2 deletions(-)
146 +
147 +diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
148 +index 84483143945..4815ded753f 100644
149 +--- a/src/cryptsetup/cryptsetup-generator.c
150 ++++ b/src/cryptsetup/cryptsetup-generator.c
151 +@@ -50,10 +50,14 @@ static int split_keyspec(const char *keyspec, char **ret_keyfile, char **ret_key
152 + _cleanup_free_ char *keyfile = NULL, *keydev = NULL;
153 + const char *c;
154 +
155 +- assert(keyspec);
156 + assert(ret_keyfile);
157 + assert(ret_keydev);
158 +
159 ++ if (!keyspec) {
160 ++ *ret_keyfile = *ret_keydev = NULL;
161 ++ return 0;
162 ++ }
163 ++
164 + c = strrchr(keyspec, ':');
165 + if (c) {
166 + keyfile = strndup(keyspec, c-keyspec);
167 +@@ -567,7 +571,7 @@ static int add_crypttab_devices(void) {
168 + }
169 +
170 + for (;;) {
171 +- _cleanup_free_ char *line = NULL, *name = NULL, *device = NULL, *keydev = NULL, *keyfile = NULL, *keyspec = NULL, *options = NULL;
172 ++ _cleanup_free_ char *line = NULL, *name = NULL, *device = NULL, *keyspec = NULL, *options = NULL, *keyfile = NULL, *keydev = NULL;
173 + crypto_device *d = NULL;
174 + char *l, *uuid;
175 + int k;
176
177 diff --git a/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch b/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch
178 new file mode 100644
179 index 00000000000..30a20c17661
180 --- /dev/null
181 +++ b/sys-apps/systemd/files/243-rc1-revert-logind-remove-unused-check.patch
182 @@ -0,0 +1,31 @@
183 +From 18f689b1fa35c53580da62bfce875fb15d20d448 Mon Sep 17 00:00:00 2001
184 +From: Yu Watanabe <watanabe.yu+github@×××××.com>
185 +Date: Sun, 4 Aug 2019 05:43:34 +0900
186 +Subject: [PATCH] Revert "logind: remove unused check"
187 +
188 +This reverts commit f2330acda408a34451d5e15380fcdd225a672473.
189 +
190 +Fixes #13255.
191 +---
192 + src/login/logind-action.c | 8 ++++++--
193 + 1 file changed, 6 insertions(+), 2 deletions(-)
194 +
195 +diff --git a/src/login/logind-action.c b/src/login/logind-action.c
196 +index fa92f4870a2..140953eec10 100644
197 +--- a/src/login/logind-action.c
198 ++++ b/src/login/logind-action.c
199 +@@ -61,8 +61,12 @@ int manager_handle_action(
200 + int r;
201 +
202 + assert(m);
203 +- /* We should be called only with valid actions different than HANDLE_IGNORE. */
204 +- assert(handle > HANDLE_IGNORE && handle < _HANDLE_ACTION_MAX);
205 ++
206 ++ /* If the key handling is turned off, don't do anything */
207 ++ if (handle == HANDLE_IGNORE) {
208 ++ log_debug("Refusing operation, as it is turned off.");
209 ++ return 0;
210 ++ }
211 +
212 + if (inhibit_key == INHIBIT_HANDLE_LID_SWITCH) {
213 + /* If the last system suspend or startup is too close,
214
215 diff --git a/sys-apps/systemd/files/243-rc1-udev-properties.patch b/sys-apps/systemd/files/243-rc1-udev-properties.patch
216 new file mode 100644
217 index 00000000000..5e2ffa1868a
218 --- /dev/null
219 +++ b/sys-apps/systemd/files/243-rc1-udev-properties.patch
220 @@ -0,0 +1,53 @@
221 +From 41c81c4a626fda0969fc09ddeb8addb7aae6e4d9 Mon Sep 17 00:00:00 2001
222 +From: Yu Watanabe <watanabe.yu+github@×××××.com>
223 +Date: Sun, 4 Aug 2019 06:08:06 +0900
224 +Subject: [PATCH] udev: do not try to import properties on commented out lines
225 +
226 +Fixes #13257.
227 +---
228 + src/udev/udev-rules.c | 10 ++++++++--
229 + 1 file changed, 8 insertions(+), 2 deletions(-)
230 +
231 +diff --git a/src/udev/udev-rules.c b/src/udev/udev-rules.c
232 +index 3473a7eb7e5..1642f105354 100644
233 +--- a/src/udev/udev-rules.c
234 ++++ b/src/udev/udev-rules.c
235 +@@ -1401,8 +1401,10 @@ static int get_property_from_string(char *line, char **ret_key, char **ret_value
236 + key = skip_leading_chars(line, NULL);
237 +
238 + /* comment or empty line */
239 +- if (IN_SET(key[0], '#', '\0'))
240 ++ if (IN_SET(key[0], '#', '\0')) {
241 ++ *ret_key = *ret_value = NULL;
242 + return 0;
243 ++ }
244 +
245 + /* split key/value */
246 + val = strchr(key, '=');
247 +@@ -1429,7 +1431,7 @@ static int get_property_from_string(char *line, char **ret_key, char **ret_value
248 +
249 + *ret_key = key;
250 + *ret_value = val;
251 +- return 0;
252 ++ return 1;
253 + }
254 +
255 + static int import_parent_into_properties(sd_device *dev, const char *filter) {
256 +@@ -1681,6 +1683,8 @@ static int udev_rule_apply_token_to_event(
257 + line);
258 + continue;
259 + }
260 ++ if (r == 0)
261 ++ continue;
262 +
263 + r = device_add_property(dev, key, value);
264 + if (r < 0)
265 +@@ -1719,6 +1723,8 @@ static int udev_rule_apply_token_to_event(
266 + line);
267 + continue;
268 + }
269 ++ if (r == 0)
270 ++ continue;
271 +
272 + r = device_add_property(dev, key, value);
273 + if (r < 0)
274
275 diff --git a/sys-apps/systemd/systemd-243_rc1-r1.ebuild b/sys-apps/systemd/systemd-243_rc1-r2.ebuild
276 similarity index 98%
277 rename from sys-apps/systemd/systemd-243_rc1-r1.ebuild
278 rename to sys-apps/systemd/systemd-243_rc1-r2.ebuild
279 index 34b6587a0db..d67b45ec87d 100644
280 --- a/sys-apps/systemd/systemd-243_rc1-r1.ebuild
281 +++ b/sys-apps/systemd/systemd-243_rc1-r2.ebuild
282 @@ -186,6 +186,9 @@ src_prepare() {
283 # Add local patches here
284 PATCHES+=(
285 "${FILESDIR}"/243-rc1-analyze.patch
286 + "${FILESDIR}"/243-rc1-cryptsetup.patch
287 + "${FILESDIR}"/243-rc1-revert-logind-remove-unused-check.patch
288 + "${FILESDIR}"/243-rc1-udev-properties.patch
289 )
290
291 if ! use vanilla; then