sys-apps/systemd: fix build with GCC 9
authorMike Gilbert <floppym@gentoo.org>
Wed, 8 May 2019 17:28:45 +0000 (13:28 -0400)
committerMike Gilbert <floppym@gentoo.org>
Wed, 8 May 2019 17:29:04 +0000 (13:29 -0400)
Closes: https://bugs.gentoo.org/685090
Package-Manager: Portage-2.3.66_p2, Repoman-2.3.12_p111
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
sys-apps/systemd/files/242-gcc-9.patch [new file with mode: 0644]
sys-apps/systemd/systemd-241-r1.ebuild
sys-apps/systemd/systemd-242.ebuild

diff --git a/sys-apps/systemd/files/242-gcc-9.patch b/sys-apps/systemd/files/242-gcc-9.patch
new file mode 100644 (file)
index 0000000..e12d657
--- /dev/null
@@ -0,0 +1,35 @@
+From c98b3545008d8e984ab456dcf79787418fcbfe13 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
+Date: Tue, 7 May 2019 13:46:55 +0200
+Subject: [PATCH] network: remove redunant link name in message
+
+Fixes #12454.
+
+gcc was complaining that the link->ifname argument is NULL. Adding
+assert(link->ifname) right before the call has no effect. It seems that
+gcc is confused by the fact that log_link_warning_errno() internally
+calls log_object(), with link->ifname passed as the object. log_object()
+is also a macro and is does a check whether the passed object is NULL.
+So we have a check if something is NULL right next an unconditional use
+of it where it cannot be NULL. I think it's a bug in gcc.
+
+Anyway, we don't need to use link->ifname here. log_object() already prepends
+the object name to the message.
+---
+ src/network/networkd-link.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
+index 533193ac932..6fc82940033 100644
+--- a/src/network/networkd-link.c
++++ b/src/network/networkd-link.c
+@@ -338,8 +338,7 @@ static int link_enable_ipv6(Link *link) {
+         r = sysctl_write_ip_property_boolean(AF_INET6, link->ifname, "disable_ipv6", disabled);
+         if (r < 0)
+-                log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
+-                                       enable_disable(!disabled), link->ifname);
++                log_link_warning_errno(link, r, "Cannot %s IPv6: %m", enable_disable(!disabled));
+         else
+                 log_link_info(link, "IPv6 successfully %sd", enable_disable(!disabled));
index e136800d06948b06b32689b367b89c11109239c5..d1c0ba26976e1493df4a16f7c4ee4a7d44763065 100644 (file)
@@ -169,6 +169,7 @@ src_prepare() {
                "${FILESDIR}"/CVE-2019-6454/0001-Refuse-dbus-message-paths-longer-than-BUS_PATH_SIZE_.patch
                "${FILESDIR}"/CVE-2019-6454/0002-Allocate-temporary-strings-to-hold-dbus-paths-on-the.patch
                "${FILESDIR}"/241-version-dep.patch
+               "${FILESDIR}"/242-gcc-9.patch
        )
 
        if ! use vanilla; then
index 201667ade310daf8f3650ec419f7128746e89971..d09494587fc5714e575a69342390b27a17f941a0 100644 (file)
@@ -170,6 +170,7 @@ src_prepare() {
 
        # Add local patches here
        PATCHES+=(
+               "${FILESDIR}"/242-gcc-9.patch
        )
 
        if ! use vanilla; then