From e70a83fbfa5bfde8348f3ca3ad4292ce71723200 Mon Sep 17 00:00:00 2001 From: Pavel Zhukov <pavel.zhukov@huawei.com> Date: Thu, 4 Nov 2021 21:31:44 +0100 Subject: [PATCH] NetworkManager: Restore fix-strerror_r.patch The patch was lost during rebase process. Closes: https://booting.oniroproject.org/distro/oniro/-/issues/181 Signed-off-by: Pavel Zhukov <pavel.zhukov@huawei.com> --- .../networkmanager/fix-strerror_r.patch | 34 +++++++++++++++++++ .../networkmanager/networkmanager_1.22.16.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch diff --git a/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch new file mode 100644 index 00000000..c284f75e --- /dev/null +++ b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager/fix-strerror_r.patch @@ -0,0 +1,34 @@ +From 18765456467af24786bc2397ca72affe42149504 Wed Sep 8 22:33:40 2021 +From: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com> +Date: Wed, 8 Sep 2021 22:33:40 +0200 +Subject: [PATCH] Fix crash on startup when using musl + +nm_strerror_native_r makes use of a glibc extension to strerror_r +when _GNU_SOURCE is defined -- even when not using glibc. + +musl uses _GNU_SOURCE for some extensions, but doesn't have the +strerror_r for unknown error codes extension -- resulting in a +NULL pointer being passed to UTF-8 check functions that don't +check for it. + +Use the non-glibc code path when __GLIBC__ isn't set. + +Signed-off-by: Bernhard Rosenkraenzer <bernhard.rosenkraenzer.ext@huawei.com> +Upstream-status: Inappropriate [problem doesn't exist in current releases] + +--- + nm-errno.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff -up NetworkManager-1.22.10/shared/nm-glib-aux/nm-errno.c.omv~ NetworkManager-1.22.10/shared/nm-glib-aux/nm-errno.c +--- NetworkManager-1.22.10/shared/nm-glib-aux/nm-errno.c.omv~ 2021-09-08 22:10:10.753007649 +0200 ++++ NetworkManager-1.22.10/shared/nm-glib-aux/nm-errno.c 2021-09-08 22:18:11.975338808 +0200 +@@ -106,7 +106,7 @@ nm_strerror_native_r (int errsv, char *b + nm_assert (buf); + nm_assert (buf_size > 0); + +-#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE ++#if !defined(__GLIBC__) || ((_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE) + /* XSI-compliant */ + { + int errno_saved = errno; diff --git a/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager_1.22.16.bb b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager_1.22.16.bb index ff784b8c..32cabd1c 100644 --- a/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager_1.22.16.bb +++ b/meta-oniro-staging/recipes-connectivity/networkmanager/networkmanager_1.22.16.bb @@ -27,6 +27,7 @@ SRC_URI = " \ file://0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \ file://0002-Do-not-create-settings-settings-property-documentati.patch \ file://fix_reallocarray_check.patch \ + file://fix-strerror_r.patch \ " SRC_URI_append_libc-musl = " \ file://musl/0001-Fix-build-with-musl-systemd-specific.patch \ -- GitLab