[yocto] [sumo] [PATCH v1] systemd: fix musl compilation

Sinan Kaya okaya at kernel.org
Fri Mar 29 07:42:52 PDT 2019


musl compilation has been broken since systemd: fix CVE-2018-6954. Fixing this
by placing #ifdef for glob definition.

Signed-off-by: Sinan Kaya <okaya at kernel.org>
---
 .../systemd/0036-Fix-musl-compilation.patch   | 27 +++++++++++++++++++
 meta/recipes-core/systemd/systemd_237.bb      |  1 +
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch

diff --git a/meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch b/meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch
new file mode 100644
index 00000000000..d12b0415f65
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0036-Fix-musl-compilation.patch
@@ -0,0 +1,27 @@
+From 8795fe183a92e6bc6a1221a5aad4103eaca13823 Mon Sep 17 00:00:00 2001
+From: Sinan Kaya <sinan.kaya at microsoft.com>
+Date: Tue, 26 Mar 2019 02:45:53 +0000
+Subject: [PATCH] Fix musl compilation
+
+Signed-off-by: Sinan Kaya <sinan.kaya at microsoft.com>
+---
+ src/tmpfiles/tmpfiles.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
+index d59ccbaa3..8d1ab0767 100644
+--- a/src/tmpfiles/tmpfiles.c
++++ b/src/tmpfiles/tmpfiles.c
+@@ -1899,7 +1899,9 @@ static int glob_item(Item *i, action_t action) {
+ 
+ static int glob_item_recursively(Item *i, fdaction_t action) {
+         _cleanup_globfree_ glob_t g = {
++#ifdef GLOB_ALTDIRFUNC
+                 .gl_opendir = (void *(*)(const char *)) opendir_nomod,
++#endif
+         };
+         int r = 0, k;
+         char **fn;
+-- 
+2.21.0
+
diff --git a/meta/recipes-core/systemd/systemd_237.bb b/meta/recipes-core/systemd/systemd_237.bb
index a0e5d512e00..3b5222a2943 100644
--- a/meta/recipes-core/systemd/systemd_237.bb
+++ b/meta/recipes-core/systemd/systemd_237.bb
@@ -65,6 +65,7 @@ SRC_URI += "file://touchscreen.rules \
            file://0002-Make-tmpfiles-safe.patch \
            file://CVE-2019-6454.patch \
            file://sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch \
+           file://0036-Fix-musl-compilation.patch \
            "
 SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch"
 
-- 
2.21.0



More information about the yocto mailing list