summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd
diff options
context:
space:
mode:
authorAndrej Valek <andrej.valek@siemens.com>2018-08-14 12:21:19 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-15 09:44:34 +0100
commit956278f4ec998ea665fc9ebe45a188bded919179 (patch)
treef10d19fd3e6bfecaa3491d60f6061a61c4f97482 /meta/recipes-core/systemd
parent04b474d53f45fa17264e550f598de81dd62343d3 (diff)
downloadpoky-956278f4ec998ea665fc9ebe45a188bded919179.tar.gz
systemd: fixes for the compatibility interface
Use a heap allocated string to set arg_ifname, since a stack allocated one would be lost after the function returns. (This last one broke the case where an interface name was suffixed with a dot, such as in `resolvconf -a tap0.dhcp`.) (From OE-Core rev: 48775d2f02d6d4024403796b81d6398f3028b965) Signed-off-by: Andrej Valek <andrej.valek@siemens.com> Signed-off-by: Simon Ausserlechner <simon.ausserlechner@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd')
-rw-r--r--meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch58
-rw-r--r--meta/recipes-core/systemd/systemd_239.bb1
2 files changed, 59 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch b/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch
new file mode 100644
index 0000000000..2f3e776aa0
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch
@@ -0,0 +1,58 @@
1systemd-239: fixes for the compatibility interface
2
3[No upstream tracking] -- https://github.com/systemd/systemd/issues/9423
4
5resolvconf-compat: use compat_main() when called as `resolvconf`,
6since the interface is closer to that of `systemd-resolve`.
7
8Use a heap allocated string to set arg_ifname, since a stack allocated
9one would be lost after the function returns. (This last one broke the
10case where an interface name was suffixed with a dot, such as in
11`resolvconf -a tap0.dhcp`.)
12
13Tested:
14 $ build/resolvconf -a nonexistent.abc </etc/resolv.conf
15 Unknown interface 'nonexistent': No such device
16
17Upstream-Status: Backport [https://github.com/systemd/systemd/commit/5a01b3f35d7b6182c78b6973db8d99bdabd4f9c3]
18bug: 9423
19Signed-off-by: Simon Ausserlechner <simon.ausserlechner@siemens.com>
20
21diff --git a/src/resolve/resolvconf-compat.c b/src/resolve/resolvconf-compat.c
22index d7e68003e..072345894 100644
23--- a/src/resolve/resolvconf-compat.c
24+++ b/src/resolve/resolvconf-compat.c
25@@ -53,6 +53,8 @@ static int parse_nameserver(const char *string) {
26
27 if (strv_push(&arg_set_dns, word) < 0)
28 return log_oom();
29+
30+ word = NULL;
31 }
32
33 return 0;
34@@ -202,7 +204,7 @@ int resolvconf_parse_argv(int argc, char *argv[]) {
35
36 dot = strchr(argv[optind], '.');
37 if (dot) {
38- iface = strndupa(argv[optind], dot - argv[optind]);
39+ iface = strndup(argv[optind], dot - argv[optind]);
40 log_debug("Ignoring protocol specifier '%s'.", dot + 1);
41 } else
42 iface = argv[optind];
43diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c
44index e96c13fea..e9e395e3e 100644
45--- a/src/resolve/resolvectl.c
46+++ b/src/resolve/resolvectl.c
47@@ -3092,7 +3092,7 @@ int main(int argc, char **argv) {
48 goto finish;
49 }
50
51- if (streq(program_invocation_short_name, "systemd-resolve"))
52+ if (STR_IN_SET(program_invocation_short_name, "systemd-resolve", "resolvconf"))
53 r = compat_main(argc, argv, bus);
54 else
55 r = native_main(argc, argv, bus);
56--
572.11.0
58
diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_239.bb
index 67f6117a2a..84906f97b7 100644
--- a/meta/recipes-core/systemd/systemd_239.bb
+++ b/meta/recipes-core/systemd/systemd_239.bb
@@ -29,6 +29,7 @@ SRC_URI += "file://touchscreen.rules \
29 file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \ 29 file://0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch \
30 file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \ 30 file://0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch \
31 file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \ 31 file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \
32 file://0023-resolvconf-fixes-for-the-compatibility-interface.patch \
32 " 33 "
33SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch" 34SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
34 35