summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-02-26 09:20:16 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-03-03 15:38:13 +0000
commit4eb2b3f1503a41474d0c40ada296a9800840267c (patch)
treea8115d141b07b7d064f434dbaa237676abb517b1
parentf1c766fc4e51ada80c022a63176aafd9b40ef07c (diff)
downloadpoky-4eb2b3f1503a41474d0c40ada296a9800840267c.tar.gz
systemd: upgrade to 241
PATCH REBASED: ============== 0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch 0004-rules-whitelist-hd-devices.patch 0007-rules-watch-metadata-changes-in-ide-devices.patch 0001-Use-getenv-when-secure-versions-are-not-available.patch 0002-don-t-use-glibc-specific-qsort_r.patch 0004-add-fallback-parse_printf_format-implementation.patch 0006-src-basic-missing.h-check-for-missing-strndupa.patch 0007-Include-netinet-if_ether.h.patch 0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch 0009-add-missing-FTW_-macros-for-musl.patch 0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch 0013-Use-uintmax_t-for-handling-rlim_t.patch 0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch 0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch PATCH DROPPED: ============== 0005-Make-root-s-home-directory-configurable.patch systemd has its hardcoded assumption about /home and /, and it also respects $HOME environment var, so this patch is somehow useless. This patch was originally added but in fact had no real runtime effect except messing up some hardcoded assumptions, and it was accidently manipulated during systemd upgrade. We have in fact not used the orignal patch for more than two releases and things were working out well. 0006-remove-nobody-user-group-checking.patch The issue has been fixed upstream by the following commit. "check nobody user/group validity only when not cross compiling" 0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch 0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch The issue has been fixed upstream by the following commit. "meson: allow building resolved and machined without nss modules" 0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch 0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch Backport 0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch Merged 0023-resolvconf-fixes-for-the-compatibility-interface.patch 0001-core-when-deserializing-state-always-use-read_line-L.patch 0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch 0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch 0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch 0001-timesync-changes-type-of-drift_freq-to-int64_t.patch Backport 0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch 0002-core-Fix-use-after-free-case-in-load_from_path.patch Merged 0001-meson-rename-Ddebug-to-Ddebug-extra.patch 0024-journald-do-not-store-the-iovec-entry-for-process-co.patch 0025-journald-set-a-limit-on-the-number-of-fields.patch 0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch CVE-2019-6454.patch sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch 0005-basic-user-util-properly-protect-use-of-gshadow.patch 0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch Backport 0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch No build failure for qemux86/qemuppc + musl PATCH ADDED: ============ 0020-missing_type.h-add-__compar_d_fn_t-definition.patch 0021-avoid-redefinition-of-prctl_mm_map-structure.patch 0022-include-sys-wait.h-to-avoid-compile-failure.patch 0023-socket-util.h-include-string.h.patch 0024-test-json.c-define-M_PIl.patch 0001-do-not-disable-buffer-in-writing-files.patch PATCH OTHERS: ============= 0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch 0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch are combined into one patch: 0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch Add two more PACKAGECONFIG, nss-mymachines and nss-resolve which are introduced by the following commit. meson: allow building resolved and machined without nss modules (From OE-Core rev: 816e08c18dbcf6e84dedc7a4bd96ddfbf2f86ebc) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/systemd/systemd.inc2
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch33
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch36
-rw-r--r--meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch21
-rw-r--r--meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch22
-rw-r--r--meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch219
-rw-r--r--meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch250
-rw-r--r--meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch39
-rw-r--r--meta/recipes-core/systemd/systemd/0001-do-not-disable-buffer-in-writing-files.patch523
-rw-r--r--meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch110
-rw-r--r--meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch45
-rw-r--r--meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch175
-rw-r--r--meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch31
-rw-r--r--meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch49
-rw-r--r--meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch43
-rw-r--r--meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch231
-rw-r--r--meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch14
-rw-r--r--meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch40
-rw-r--r--meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch8
-rw-r--r--meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch61
-rw-r--r--meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch33
-rw-r--r--meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch18
-rw-r--r--meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch70
-rw-r--r--meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch38
-rw-r--r--meta/recipes-core/systemd/systemd/0005-rules-watch-metadata-changes-in-ide-devices.patch (renamed from meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch)18
-rw-r--r--meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch (renamed from meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch)90
-rw-r--r--meta/recipes-core/systemd/systemd/0006-Include-netinet-if_ether.h.patch (renamed from meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch)28
-rw-r--r--meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch63
-rw-r--r--meta/recipes-core/systemd/systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch (renamed from meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch)49
-rw-r--r--meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch29
-rw-r--r--meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch (renamed from meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch)29
-rw-r--r--meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch43
-rw-r--r--meta/recipes-core/systemd/systemd/0009-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch (renamed from meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch)10
-rw-r--r--meta/recipes-core/systemd/systemd/0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch (renamed from meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch)16
-rw-r--r--meta/recipes-core/systemd/systemd/0011-Use-uintmax_t-for-handling-rlim_t.patch (renamed from meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch)59
-rw-r--r--meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch48
-rw-r--r--meta/recipes-core/systemd/systemd/0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch27
-rw-r--r--meta/recipes-core/systemd/systemd/0013-test-hexdecoct.c-Include-missing.h-for-strndupa.patch (renamed from meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch)8
-rw-r--r--meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch30
-rw-r--r--meta/recipes-core/systemd/systemd/0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch (renamed from meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch)12
-rw-r--r--meta/recipes-core/systemd/systemd/0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch (renamed from meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch)10
-rw-r--r--meta/recipes-core/systemd/systemd/0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch (renamed from meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch)8
-rw-r--r--meta/recipes-core/systemd/systemd/0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch (renamed from meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch)10
-rw-r--r--meta/recipes-core/systemd/systemd/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch (renamed from meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch)12
-rw-r--r--meta/recipes-core/systemd/systemd/0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch35
-rw-r--r--meta/recipes-core/systemd/systemd/0020-missing_type.h-add-__compar_d_fn_t-definition.patch30
-rw-r--r--meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch34
-rw-r--r--meta/recipes-core/systemd/systemd/0021-avoid-redefinition-of-prctl_mm_map-structure.patch47
-rw-r--r--meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch28
-rw-r--r--meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch109
-rw-r--r--meta/recipes-core/systemd/systemd/0022-include-sys-wait.h-to-avoid-compile-failure.patch33
-rw-r--r--meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch58
-rw-r--r--meta/recipes-core/systemd/systemd/0023-socket-util.h-include-string.h.patch30
-rw-r--r--meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch208
-rw-r--r--meta/recipes-core/systemd/systemd/0024-test-json.c-define-M_PIl.patch33
-rw-r--r--meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch139
-rw-r--r--meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch49
-rw-r--r--meta/recipes-core/systemd/systemd/CVE-2019-6454.patch210
-rw-r--r--meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch61
-rw-r--r--meta/recipes-core/systemd/systemd_241.bb (renamed from meta/recipes-core/systemd/systemd_239.bb)79
60 files changed, 1198 insertions, 2695 deletions
diff --git a/meta/recipes-core/systemd/systemd.inc b/meta/recipes-core/systemd/systemd.inc
index 736e0a0ea0..8ca3ece441 100644
--- a/meta/recipes-core/systemd/systemd.inc
+++ b/meta/recipes-core/systemd/systemd.inc
@@ -14,7 +14,7 @@ LICENSE = "GPLv2 & LGPLv2.1"
14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ 14LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \
15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c" 15 file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c"
16 16
17SRCREV = "de7436b02badc82200dc127ff190b8155769b8e7" 17SRCREV = "e62a7fea757f259eb330da5b6d3ab4ede46400a2"
18 18
19SRC_URI = "git://github.com/systemd/systemd.git;protocol=git" 19SRC_URI = "git://github.com/systemd/systemd.git;protocol=git"
20 20
diff --git a/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch b/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
deleted file mode 100644
index d745800ced..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch
+++ /dev/null
@@ -1,33 +0,0 @@
1From 9e3816bcaa36e1a11647ca0cf4f8044449c77fe0 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 2 Jul 2018 15:28:22 +0800
4Subject: [PATCH] Remove fstack-protector flags to workaround musl build
5
6Remove fstack-protector and fstack-protector-strong flags to fix
7the following build failure for qemux86 and qemuppc with musl.
8
9 undefined reference to `__stack_chk_fail_local'
10
11Upstream-Status: Inappropriate [musl Specific]
12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 meson.build | 2 --
16 1 file changed, 2 deletions(-)
17
18diff --git a/meson.build b/meson.build
19index f432ea072..a734a295c 100644
20--- a/meson.build
21+++ b/meson.build
22@@ -333,8 +333,6 @@ possible_cc_flags = [
23 '-fdiagnostics-show-option',
24 '-fno-strict-aliasing',
25 '-fvisibility=hidden',
26- '-fstack-protector',
27- '-fstack-protector-strong',
28 '--param=ssp-buffer-size=4',
29 ]
30
31--
322.11.0
33
diff --git a/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch b/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch
deleted file mode 100644
index 7fd6d0188e..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch
+++ /dev/null
@@ -1,36 +0,0 @@
1From 1e190dfd5bb95036f937ef1dc46f43eb0a146612 Mon Sep 17 00:00:00 2001
2From: Thomas Hindoe Paaboel Andersen <phomes@gmail.com>
3Date: Fri, 17 Aug 2018 21:31:05 +0200
4Subject: [PATCH] Revert "sysctl.d: request ECN on both in and outgoing
5 connections"
6
7Turning on ECN still causes slow or broken network on linux. Our tcp
8is not yet ready for wide spread use of ECN.
9
10This reverts commit 919472741dba6ad0a3f6c2b76d390a02d0e2fdc3.
11
12https://github.com/systemd/systemd/issues/9748
13
14Upstream-Status: Backport
15Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
16---
17 sysctl.d/50-default.conf | 3 ---
18 1 file changed, 3 deletions(-)
19
20diff --git a/sysctl.d/50-default.conf b/sysctl.d/50-default.conf
21index b67ae87ca6b7..e263cf06284a 100644
22--- a/sysctl.d/50-default.conf
23+++ b/sysctl.d/50-default.conf
24@@ -33,9 +33,6 @@ net.ipv4.conf.all.promote_secondaries = 1
25 # Fair Queue CoDel packet scheduler to fight bufferbloat
26 net.core.default_qdisc = fq_codel
27
28-# Request Explicit Congestion Notification (ECN) on both in and outgoing connections
29-net.ipv4.tcp_ecn = 1
30-
31 # Enable hard and soft link protection
32 fs.protected_hardlinks = 1
33 fs.protected_symlinks = 1
34--
352.7.4
36
diff --git a/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch b/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
index 03f6ead131..37979755d0 100644
--- a/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
+++ b/meta/recipes-core/systemd/systemd/0001-Use-getenv-when-secure-versions-are-not-available.patch
@@ -1,7 +1,7 @@
1From 6dd136512896979feb6883a16226d640a7e5ca74 Mon Sep 17 00:00:00 2001 1From b8055a61b5df6b43b8d3117936587b874b0a339b Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 23 Feb 2018 10:04:48 +0800 3Date: Mon, 25 Feb 2019 11:01:18 +0800
4Subject: [PATCH 01/19] Use getenv when secure versions are not available 4Subject: [PATCH 01/24] Use getenv when secure versions are not available
5 5
6musl doesnt implement secure version, so we default 6musl doesnt implement secure version, so we default
7to it if configure does not detect a secure implementation 7to it if configure does not detect a secure implementation
@@ -12,14 +12,14 @@ Upstream-Status: Denied
12 12
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14--- 14---
15 src/basic/missing.h | 2 +- 15 src/basic/missing_stdlib.h | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-) 16 1 file changed, 1 insertion(+), 1 deletion(-)
17 17
18diff --git a/src/basic/missing.h b/src/basic/missing.h 18diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h
19index 71a07d057..0e33abb9f 100644 19index 188a8d4..c0ffe86 100644
20--- a/src/basic/missing.h 20--- a/src/basic/missing_stdlib.h
21+++ b/src/basic/missing.h 21+++ b/src/basic/missing_stdlib.h
22@@ -592,7 +592,7 @@ struct btrfs_ioctl_quota_ctl_args { 22@@ -8,6 +8,6 @@
23 # if HAVE___SECURE_GETENV 23 # if HAVE___SECURE_GETENV
24 # define secure_getenv __secure_getenv 24 # define secure_getenv __secure_getenv
25 # else 25 # else
@@ -27,7 +27,6 @@ index 71a07d057..0e33abb9f 100644
27+# define secure_getenv getenv 27+# define secure_getenv getenv
28 # endif 28 # endif
29 #endif 29 #endif
30
31-- 30--
322.11.0 312.7.4
33 32
diff --git a/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch b/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
index e24e7f83fc..00670ca2b1 100644
--- a/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
+++ b/meta/recipes-core/systemd/systemd/0001-binfmt-Don-t-install-dependency-links-at-install-tim.patch
@@ -1,7 +1,7 @@
1From 87dd61be2e28e78ce4f9f173794812e6c2d904d1 Mon Sep 17 00:00:00 2001 1From 98254e4798e79d52ac6b562616cd244120f6e239 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 27 Jun 2018 16:01:22 +0800 3Date: Thu, 21 Feb 2019 16:23:24 +0800
4Subject: [PATCH 1/9] binfmt: Don't install dependency links at install time 4Subject: [PATCH 1/5] binfmt: Don't install dependency links at install time
5 for the binfmt services 5 for the binfmt services
6 6
7use [Install] blocks so that they get created when the service is enabled 7use [Install] blocks so that they get created when the service is enabled
@@ -23,10 +23,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
23 3 files changed, 9 insertions(+), 4 deletions(-) 23 3 files changed, 9 insertions(+), 4 deletions(-)
24 24
25diff --git a/units/meson.build b/units/meson.build 25diff --git a/units/meson.build b/units/meson.build
26index e4ac6ced6..698734e44 100644 26index d695084..7b1f14a 100644
27--- a/units/meson.build 27--- a/units/meson.build
28+++ b/units/meson.build 28+++ b/units/meson.build
29@@ -46,8 +46,7 @@ units = [ 29@@ -47,8 +47,7 @@ units = [
30 ['poweroff.target', '', 30 ['poweroff.target', '',
31 'runlevel0.target'], 31 'runlevel0.target'],
32 ['printer.target', ''], 32 ['printer.target', ''],
@@ -36,18 +36,18 @@ index e4ac6ced6..698734e44 100644
36 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'], 36 ['proc-sys-fs-binfmt_misc.mount', 'ENABLE_BINFMT'],
37 ['reboot.target', '', 37 ['reboot.target', '',
38 'runlevel6.target ctrl-alt-del.target'], 38 'runlevel6.target ctrl-alt-del.target'],
39@@ -130,8 +129,7 @@ in_units = [ 39@@ -134,8 +133,7 @@ in_units = [
40 ['systemd-ask-password-console.service', ''], 40 ['systemd-ask-password-console.service', ''],
41 ['systemd-ask-password-wall.service', ''], 41 ['systemd-ask-password-wall.service', ''],
42 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'], 42 ['systemd-backlight@.service', 'ENABLE_BACKLIGHT'],
43- ['systemd-binfmt.service', 'ENABLE_BINFMT', 43- ['systemd-binfmt.service', 'ENABLE_BINFMT',
44- 'sysinit.target.wants/'], 44- 'sysinit.target.wants/'],
45+ ['systemd-binfmt.service', 'ENABLE_BINFMT'], 45+ ['systemd-binfmt.service', 'ENABLE_BINFMT'],
46 ['systemd-bless-boot.service', 'ENABLE_EFI HAVE_BLKID'],
47 ['systemd-boot-check-no-failures.service', ''],
46 ['systemd-coredump@.service', 'ENABLE_COREDUMP'], 48 ['systemd-coredump@.service', 'ENABLE_COREDUMP'],
47 ['systemd-exit.service', ''],
48 ['systemd-firstboot.service', 'ENABLE_FIRSTBOOT',
49diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount 49diff --git a/units/proc-sys-fs-binfmt_misc.automount b/units/proc-sys-fs-binfmt_misc.automount
50index 30a6bc991..4231f3b70 100644 50index 30a6bc9..4231f3b 100644
51--- a/units/proc-sys-fs-binfmt_misc.automount 51--- a/units/proc-sys-fs-binfmt_misc.automount
52+++ b/units/proc-sys-fs-binfmt_misc.automount 52+++ b/units/proc-sys-fs-binfmt_misc.automount
53@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/ 53@@ -18,3 +18,6 @@ ConditionPathIsReadWrite=/proc/sys/
@@ -58,7 +58,7 @@ index 30a6bc991..4231f3b70 100644
58+[Install] 58+[Install]
59+WantedBy=sysinit.target 59+WantedBy=sysinit.target
60diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in 60diff --git a/units/systemd-binfmt.service.in b/units/systemd-binfmt.service.in
61index e940c7c9a..6be7f5cc9 100644 61index e940c7c..6be7f5c 100644
62--- a/units/systemd-binfmt.service.in 62--- a/units/systemd-binfmt.service.in
63+++ b/units/systemd-binfmt.service.in 63+++ b/units/systemd-binfmt.service.in
64@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm 64@@ -14,6 +14,7 @@ Documentation=https://www.kernel.org/doc/html/latest/admin-guide/binfmt-misc.htm
@@ -77,5 +77,5 @@ index e940c7c9a..6be7f5cc9 100644
77+[Install] 77+[Install]
78+WantedBy=sysinit.target 78+WantedBy=sysinit.target
79-- 79--
802.11.0 802.7.4
81 81
diff --git a/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch b/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch
deleted file mode 100644
index 9d350ebade..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch
+++ /dev/null
@@ -1,219 +0,0 @@
1From 2da8ba3f507345d0401ea9d7191fa16ffa560ebc Mon Sep 17 00:00:00 2001
2From: Lennart Poettering <lennart@poettering.net>
3Date: Fri, 19 Oct 2018 11:26:59 +0200
4Subject: [PATCH] chown-recursive: let's rework the recursive logic to use
5 O_PATH
6
7That way we can pin a specific inode and analyze it and manipulate it
8without it being swapped out beneath our hands.
9
10Fixes a vulnerability originally found by Jann Horn from Google.
11
12CVE-2018-15687
13LP: #1796692
14https://bugzilla.redhat.com/show_bug.cgi?id=1639076
15
16(cherry picked from commit 5de6cce58b3e8b79239b6e83653459d91af6e57c)
17
18CVE: CVE-2018-15687
19Upstream-Status: Backport
20
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22---
23 src/core/chown-recursive.c | 146 ++++++++++++++++++++++-----------------------
24 1 file changed, 70 insertions(+), 76 deletions(-)
25
26diff --git a/src/core/chown-recursive.c b/src/core/chown-recursive.c
27index c479450..27c6448 100644
28--- a/src/core/chown-recursive.c
29+++ b/src/core/chown-recursive.c
30@@ -1,17 +1,19 @@
31 /* SPDX-License-Identifier: LGPL-2.1+ */
32
33-#include <sys/types.h>
34-#include <sys/stat.h>
35 #include <fcntl.h>
36+#include <sys/stat.h>
37+#include <sys/types.h>
38
39-#include "user-util.h"
40-#include "macro.h"
41-#include "fd-util.h"
42-#include "dirent-util.h"
43 #include "chown-recursive.h"
44+#include "dirent-util.h"
45+#include "fd-util.h"
46+#include "macro.h"
47+#include "stdio-util.h"
48+#include "strv.h"
49+#include "user-util.h"
50
51-static int chown_one(int fd, const char *name, const struct stat *st, uid_t uid, gid_t gid) {
52- int r;
53+static int chown_one(int fd, const struct stat *st, uid_t uid, gid_t gid) {
54+ char procfs_path[STRLEN("/proc/self/fd/") + DECIMAL_STR_MAX(int) + 1];
55
56 assert(fd >= 0);
57 assert(st);
58@@ -20,90 +22,82 @@ static int chown_one(int fd, const char *name, const struct stat *st, uid_t uid,
59 (!gid_is_valid(gid) || st->st_gid == gid))
60 return 0;
61
62- if (name)
63- r = fchownat(fd, name, uid, gid, AT_SYMLINK_NOFOLLOW);
64- else
65- r = fchown(fd, uid, gid);
66- if (r < 0)
67- return -errno;
68+ /* We change ownership through the /proc/self/fd/%i path, so that we have a stable reference that works with
69+ * O_PATH. (Note: fchown() and fchmod() do not work with O_PATH, the kernel refuses that. */
70+ xsprintf(procfs_path, "/proc/self/fd/%i", fd);
71
72- /* The linux kernel alters the mode in some cases of chown(). Let's undo this. */
73- if (name) {
74- if (!S_ISLNK(st->st_mode))
75- r = fchmodat(fd, name, st->st_mode, 0);
76- else /* There's currently no AT_SYMLINK_NOFOLLOW for fchmodat() */
77- r = 0;
78- } else
79- r = fchmod(fd, st->st_mode);
80- if (r < 0)
81+ if (chown(procfs_path, uid, gid) < 0)
82 return -errno;
83
84+ /* The linux kernel alters the mode in some cases of chown(). Let's undo this. We do this only for non-symlinks
85+ * however. That's because for symlinks the access mode is ignored anyway and because on some kernels/file
86+ * systems trying to change the access mode will succeed but has no effect while on others it actively
87+ * fails. */
88+ if (!S_ISLNK(st->st_mode))
89+ if (chmod(procfs_path, st->st_mode & 07777) < 0)
90+ return -errno;
91+
92 return 1;
93 }
94
95 static int chown_recursive_internal(int fd, const struct stat *st, uid_t uid, gid_t gid) {
96+ _cleanup_closedir_ DIR *d = NULL;
97 bool changed = false;
98+ struct dirent *de;
99 int r;
100
101 assert(fd >= 0);
102 assert(st);
103
104- if (S_ISDIR(st->st_mode)) {
105- _cleanup_closedir_ DIR *d = NULL;
106- struct dirent *de;
107-
108- d = fdopendir(fd);
109- if (!d) {
110- r = -errno;
111- goto finish;
112- }
113- fd = -1;
114-
115- FOREACH_DIRENT_ALL(de, d, r = -errno; goto finish) {
116- struct stat fst;
117-
118- if (dot_or_dot_dot(de->d_name))
119- continue;
120-
121- if (fstatat(dirfd(d), de->d_name, &fst, AT_SYMLINK_NOFOLLOW) < 0) {
122- r = -errno;
123- goto finish;
124- }
125-
126- if (S_ISDIR(fst.st_mode)) {
127- int subdir_fd;
128-
129- subdir_fd = openat(dirfd(d), de->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
130- if (subdir_fd < 0) {
131- r = -errno;
132- goto finish;
133- }
134-
135- r = chown_recursive_internal(subdir_fd, &fst, uid, gid);
136- if (r < 0)
137- goto finish;
138- if (r > 0)
139- changed = true;
140- } else {
141- r = chown_one(dirfd(d), de->d_name, &fst, uid, gid);
142- if (r < 0)
143- goto finish;
144- if (r > 0)
145- changed = true;
146- }
147+ d = fdopendir(fd);
148+ if (!d) {
149+ safe_close(fd);
150+ return -errno;
151+ }
152+
153+ FOREACH_DIRENT_ALL(de, d, return -errno) {
154+ _cleanup_close_ int path_fd = -1;
155+ struct stat fst;
156+
157+ if (dot_or_dot_dot(de->d_name))
158+ continue;
159+
160+ /* Let's pin the child inode we want to fix now with an O_PATH fd, so that it cannot be swapped out
161+ * while we manipulate it. */
162+ path_fd = openat(dirfd(d), de->d_name, O_PATH|O_CLOEXEC|O_NOFOLLOW);
163+ if (path_fd < 0)
164+ return -errno;
165+
166+ if (fstat(path_fd, &fst) < 0)
167+ return -errno;
168+
169+ if (S_ISDIR(fst.st_mode)) {
170+ int subdir_fd;
171+
172+ /* Convert it to a "real" (i.e. non-O_PATH) fd now */
173+ subdir_fd = fd_reopen(path_fd, O_RDONLY|O_CLOEXEC|O_NOATIME);
174+ if (subdir_fd < 0)
175+ return subdir_fd;
176+
177+ r = chown_recursive_internal(subdir_fd, &fst, uid, gid); /* takes possession of subdir_fd even on failure */
178+ if (r < 0)
179+ return r;
180+ if (r > 0)
181+ changed = true;
182+ } else {
183+ r = chown_one(path_fd, &fst, uid, gid);
184+ if (r < 0)
185+ return r;
186+ if (r > 0)
187+ changed = true;
188 }
189+ }
190
191- r = chown_one(dirfd(d), NULL, st, uid, gid);
192- } else
193- r = chown_one(fd, NULL, st, uid, gid);
194+ r = chown_one(dirfd(d), st, uid, gid);
195 if (r < 0)
196- goto finish;
197+ return r;
198
199- r = r > 0 || changed;
200-
201-finish:
202- safe_close(fd);
203- return r;
204+ return r > 0 || changed;
205 }
206
207 int path_chown_recursive(const char *path, uid_t uid, gid_t gid) {
208@@ -111,7 +105,7 @@ int path_chown_recursive(const char *path, uid_t uid, gid_t gid) {
209 struct stat st;
210 int r;
211
212- fd = open(path, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
213+ fd = open(path, O_RDONLY|O_DIRECTORY|O_CLOEXEC|O_NOFOLLOW|O_NOATIME);
214 if (fd < 0)
215 return -errno;
216
217--
2182.7.4
219
diff --git a/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch b/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch
deleted file mode 100644
index 215d68076a..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-core-when-deserializing-state-always-use-read_line-L.patch
+++ /dev/null
@@ -1,250 +0,0 @@
1From 1a05ff4948d778280ec155a9abe69d3360bfddd9 Mon Sep 17 00:00:00 2001
2From: Lennart Poettering <lennart@poettering.net>
3Date: Wed, 17 Oct 2018 18:36:24 +0200
4Subject: [PATCH] =?UTF-8?q?core:=20when=20deserializing=20state=20always?=
5 =?UTF-8?q?=20use=20read=5Fline(=E2=80=A6,=20LONG=5FLINE=5FMAX,=20?=
6 =?UTF-8?q?=E2=80=A6)?=
7MIME-Version: 1.0
8Content-Type: text/plain; charset=UTF-8
9Content-Transfer-Encoding: 8bit
10
11This should be much better than fgets(), as we can read substantially
12longer lines and overly long lines result in proper errors.
13
14Fixes a vulnerability discovered by Jann Horn at Google.
15
16CVE-2018-15686
17LP: #1796402
18https://bugzilla.redhat.com/show_bug.cgi?id=1639071
19
20(cherry picked from commit 8948b3415d762245ebf5e19d80b97d4d8cc208c1)
21
22CVE: CVE-2018-15686
23Upstream-Status: Backport
24
25Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
26---
27 src/core/job.c | 19 +++++++++++--------
28 src/core/manager.c | 44 ++++++++++++++++++++------------------------
29 src/core/unit.c | 34 ++++++++++++++++++----------------
30 src/core/unit.h | 2 +-
31 4 files changed, 50 insertions(+), 49 deletions(-)
32
33diff --git a/src/core/job.c b/src/core/job.c
34index 734756b..8552ffb 100644
35--- a/src/core/job.c
36+++ b/src/core/job.c
37@@ -10,6 +10,7 @@
38 #include "dbus-job.h"
39 #include "dbus.h"
40 #include "escape.h"
41+#include "fileio.h"
42 #include "job.h"
43 #include "log.h"
44 #include "macro.h"
45@@ -1091,24 +1092,26 @@ int job_serialize(Job *j, FILE *f) {
46 }
47
48 int job_deserialize(Job *j, FILE *f) {
49+ int r;
50+
51 assert(j);
52 assert(f);
53
54 for (;;) {
55- char line[LINE_MAX], *l, *v;
56+ _cleanup_free_ char *line = NULL;
57+ char *l, *v;
58 size_t k;
59
60- if (!fgets(line, sizeof(line), f)) {
61- if (feof(f))
62- return 0;
63- return -errno;
64- }
65+ r = read_line(f, LONG_LINE_MAX, &line);
66+ if (r < 0)
67+ return log_error_errno(r, "Failed to read serialization line: %m");
68+ if (r == 0)
69+ return 0;
70
71- char_array_0(line);
72 l = strstrip(line);
73
74 /* End marker */
75- if (l[0] == 0)
76+ if (isempty(l))
77 return 0;
78
79 k = strcspn(l, "=");
80diff --git a/src/core/manager.c b/src/core/manager.c
81index 3a7f0c4..a5780c9 100644
82--- a/src/core/manager.c
83+++ b/src/core/manager.c
84@@ -3171,22 +3171,19 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
85 m->n_reloading++;
86
87 for (;;) {
88- char line[LINE_MAX];
89+ _cleanup_free_ char *line = NULL;
90 const char *val, *l;
91
92- if (!fgets(line, sizeof(line), f)) {
93- if (feof(f))
94- r = 0;
95- else
96- r = -errno;
97-
98+ r = read_line(f, LONG_LINE_MAX, &line);
99+ if (r < 0) {
100+ log_error_errno(r, "Failed to read serialization line: %m");
101 goto finish;
102 }
103+ if (r == 0)
104+ break;
105
106- char_array_0(line);
107 l = strstrip(line);
108-
109- if (l[0] == 0)
110+ if (isempty(l)) /* end marker */
111 break;
112
113 if ((val = startswith(l, "current-job-id="))) {
114@@ -3353,29 +3350,31 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
115 }
116
117 for (;;) {
118- Unit *u;
119- char name[UNIT_NAME_MAX+2];
120+ _cleanup_free_ char *line = NULL;
121 const char* unit_name;
122+ Unit *u;
123
124 /* Start marker */
125- if (!fgets(name, sizeof(name), f)) {
126- if (feof(f))
127- r = 0;
128- else
129- r = -errno;
130-
131+ r = read_line(f, LONG_LINE_MAX, &line);
132+ if (r < 0) {
133+ log_error_errno(r, "Failed to read serialization line: %m");
134 goto finish;
135 }
136+ if (r == 0)
137+ break;
138
139- char_array_0(name);
140- unit_name = strstrip(name);
141+ unit_name = strstrip(line);
142
143 r = manager_load_unit(m, unit_name, NULL, NULL, &u);
144 if (r < 0) {
145 log_notice_errno(r, "Failed to load unit \"%s\", skipping deserialization: %m", unit_name);
146 if (r == -ENOMEM)
147 goto finish;
148- unit_deserialize_skip(f);
149+
150+ r = unit_deserialize_skip(f);
151+ if (r < 0)
152+ goto finish;
153+
154 continue;
155 }
156
157@@ -3388,9 +3387,6 @@ int manager_deserialize(Manager *m, FILE *f, FDSet *fds) {
158 }
159
160 finish:
161- if (ferror(f))
162- r = -EIO;
163-
164 assert(m->n_reloading > 0);
165 m->n_reloading--;
166
167diff --git a/src/core/unit.c b/src/core/unit.c
168index 7da963a..e98c9c4 100644
169--- a/src/core/unit.c
170+++ b/src/core/unit.c
171@@ -3380,21 +3380,19 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
172 assert(fds);
173
174 for (;;) {
175- char line[LINE_MAX], *l, *v;
176+ _cleanup_free_ char *line = NULL;
177 CGroupIPAccountingMetric m;
178+ char *l, *v;
179 size_t k;
180
181- if (!fgets(line, sizeof(line), f)) {
182- if (feof(f))
183- return 0;
184- return -errno;
185- }
186+ r = read_line(f, LONG_LINE_MAX, &line);
187+ if (r < 0)
188+ return log_error_errno(r, "Failed to read serialization line: %m");
189+ if (r == 0) /* eof */
190+ break;
191
192- char_array_0(line);
193 l = strstrip(line);
194-
195- /* End marker */
196- if (isempty(l))
197+ if (isempty(l)) /* End marker */
198 break;
199
200 k = strcspn(l, "=");
201@@ -3671,23 +3669,27 @@ int unit_deserialize(Unit *u, FILE *f, FDSet *fds) {
202 return 0;
203 }
204
205-void unit_deserialize_skip(FILE *f) {
206+int unit_deserialize_skip(FILE *f) {
207+ int r;
208 assert(f);
209
210 /* Skip serialized data for this unit. We don't know what it is. */
211
212 for (;;) {
213- char line[LINE_MAX], *l;
214+ _cleanup_free_ char *line = NULL;
215+ char *l;
216
217- if (!fgets(line, sizeof line, f))
218- return;
219+ r = read_line(f, LONG_LINE_MAX, &line);
220+ if (r < 0)
221+ return log_error_errno(r, "Failed to read serialization line: %m");
222+ if (r == 0)
223+ return 0;
224
225- char_array_0(line);
226 l = strstrip(line);
227
228 /* End marker */
229 if (isempty(l))
230- return;
231+ return 1;
232 }
233 }
234
235diff --git a/src/core/unit.h b/src/core/unit.h
236index 06321bb..51c7aaa 100644
237--- a/src/core/unit.h
238+++ b/src/core/unit.h
239@@ -684,7 +684,7 @@ bool unit_can_serialize(Unit *u) _pure_;
240
241 int unit_serialize(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs);
242 int unit_deserialize(Unit *u, FILE *f, FDSet *fds);
243-void unit_deserialize_skip(FILE *f);
244+int unit_deserialize_skip(FILE *f);
245
246 int unit_serialize_item(Unit *u, FILE *f, const char *key, const char *value);
247 int unit_serialize_item_escaped(Unit *u, FILE *f, const char *key, const char *value);
248--
2492.7.4
250
diff --git a/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch b/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
deleted file mode 100644
index 0c912f25df..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch
+++ /dev/null
@@ -1,39 +0,0 @@
1From a2622b8398ba026faf481f5eddeb53231d9de4a7 Mon Sep 17 00:00:00 2001
2From: Lennart Poettering <lennart@poettering.net>
3Date: Fri, 19 Oct 2018 12:12:33 +0200
4Subject: [PATCH] dhcp6: make sure we have enough space for the DHCP6 option
5 header
6
7Fixes a vulnerability originally discovered by Felix Wilhelm from
8Google.
9
10CVE-2018-15688
11LP: #1795921
12https://bugzilla.redhat.com/show_bug.cgi?id=1639067
13
14(cherry picked from commit 4dac5eaba4e419b29c97da38a8b1f82336c2c892)
15
16CVE: CVE-2018-15688
17Upstream-Status: Backport
18
19Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
20---
21 src/libsystemd-network/dhcp6-option.c | 2 +-
22 1 file changed, 1 insertion(+), 1 deletion(-)
23
24diff --git a/src/libsystemd-network/dhcp6-option.c b/src/libsystemd-network/dhcp6-option.c
25index c4b402b..dcbaad0 100644
26--- a/src/libsystemd-network/dhcp6-option.c
27+++ b/src/libsystemd-network/dhcp6-option.c
28@@ -103,7 +103,7 @@ int dhcp6_option_append_ia(uint8_t **buf, size_t *buflen, DHCP6IA *ia) {
29 return -EINVAL;
30 }
31
32- if (*buflen < len)
33+ if (*buflen < offsetof(DHCP6Option, data) + len)
34 return -ENOBUFS;
35
36 ia_hdr = *buf;
37--
382.7.4
39
diff --git a/meta/recipes-core/systemd/systemd/0001-do-not-disable-buffer-in-writing-files.patch b/meta/recipes-core/systemd/systemd/0001-do-not-disable-buffer-in-writing-files.patch
new file mode 100644
index 0000000000..a6857b1f47
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0001-do-not-disable-buffer-in-writing-files.patch
@@ -0,0 +1,523 @@
1From 85e3c3046562ec24fc2f09ebfd08bf9f168091d5 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 1 Mar 2019 15:22:15 +0800
4Subject: [PATCH] do not disable buffer in writing files
5
6Do not disable buffer in writing files, otherwise we get
7failure at boot for musl like below.
8
9 [!!!!!!] Failed to allocate manager object.
10
11And there will be other failures, critical or not critical.
12This is specific to musl.
13
14Upstream-Status: Inappropriate [musl]
15
16Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
17---
18 src/basic/cgroup-util.c | 14 +++++++-------
19 src/basic/procfs-util.c | 4 ++--
20 src/basic/smack-util.c | 2 +-
21 src/basic/util.c | 2 +-
22 src/binfmt/binfmt.c | 6 +++---
23 src/core/main.c | 4 ++--
24 src/core/smack-setup.c | 8 ++++----
25 src/hibernate-resume/hibernate-resume.c | 2 +-
26 src/libsystemd/sd-device/sd-device.c | 2 +-
27 src/login/logind-dbus.c | 2 +-
28 src/network/networkd-ipv6-proxy-ndp.c | 2 +-
29 src/network/networkd-link.c | 18 +++++++++---------
30 src/nspawn/nspawn-cgroup.c | 2 +-
31 src/nspawn/nspawn.c | 6 +++---
32 src/sleep/sleep.c | 12 ++++++------
33 src/udev/udevadm-trigger.c | 2 +-
34 src/udev/udevd.c | 6 +++---
35 src/vconsole/vconsole-setup.c | 2 +-
36 18 files changed, 48 insertions(+), 48 deletions(-)
37
38diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c
39index 8ce7ccb..b633226 100644
40--- a/src/basic/cgroup-util.c
41+++ b/src/basic/cgroup-util.c
42@@ -818,7 +818,7 @@ int cg_attach(const char *controller, const char *path, pid_t pid) {
43
44 xsprintf(c, PID_FMT "\n", pid);
45
46- r = write_string_file(fs, c, WRITE_STRING_FILE_DISABLE_BUFFER);
47+ r = write_string_file(fs, c, 0);
48 if (r < 0)
49 return r;
50
51@@ -1100,7 +1100,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
52
53 sc = strstrip(contents);
54 if (isempty(sc)) {
55- r = write_string_file(fs, agent, WRITE_STRING_FILE_DISABLE_BUFFER);
56+ r = write_string_file(fs, agent, 0);
57 if (r < 0)
58 return r;
59 } else if (!path_equal(sc, agent))
60@@ -1118,7 +1118,7 @@ int cg_install_release_agent(const char *controller, const char *agent) {
61
62 sc = strstrip(contents);
63 if (streq(sc, "0")) {
64- r = write_string_file(fs, "1", WRITE_STRING_FILE_DISABLE_BUFFER);
65+ r = write_string_file(fs, "1", 0);
66 if (r < 0)
67 return r;
68
69@@ -1145,7 +1145,7 @@ int cg_uninstall_release_agent(const char *controller) {
70 if (r < 0)
71 return r;
72
73- r = write_string_file(fs, "0", WRITE_STRING_FILE_DISABLE_BUFFER);
74+ r = write_string_file(fs, "0", 0);
75 if (r < 0)
76 return r;
77
78@@ -1155,7 +1155,7 @@ int cg_uninstall_release_agent(const char *controller) {
79 if (r < 0)
80 return r;
81
82- r = write_string_file(fs, "", WRITE_STRING_FILE_DISABLE_BUFFER);
83+ r = write_string_file(fs, "", 0);
84 if (r < 0)
85 return r;
86
87@@ -2012,7 +2012,7 @@ int cg_set_attribute(const char *controller, const char *path, const char *attri
88 if (r < 0)
89 return r;
90
91- return write_string_file(p, value, WRITE_STRING_FILE_DISABLE_BUFFER);
92+ return write_string_file(p, value, 0);
93 }
94
95 int cg_get_attribute(const char *controller, const char *path, const char *attribute, char **ret) {
96@@ -2660,7 +2660,7 @@ int cg_enable_everywhere(
97 return log_debug_errno(errno, "Failed to open cgroup.subtree_control file of %s: %m", p);
98 }
99
100- r = write_string_stream(f, s, WRITE_STRING_FILE_DISABLE_BUFFER);
101+ r = write_string_stream(f, s, 0);
102 if (r < 0) {
103 log_debug_errno(r, "Failed to %s controller %s for %s (%s): %m",
104 FLAGS_SET(mask, bit) ? "enable" : "disable", n, p, fs);
105diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
106index 42ce53d..5751253 100644
107--- a/src/basic/procfs-util.c
108+++ b/src/basic/procfs-util.c
109@@ -86,13 +86,13 @@ int procfs_tasks_set_limit(uint64_t limit) {
110 * decrease it, as threads-max is the much more relevant sysctl. */
111 if (limit > pid_max-1) {
112 sprintf(buffer, "%" PRIu64, limit+1); /* Add one, since PID 0 is not a valid PID */
113- r = write_string_file("/proc/sys/kernel/pid_max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
114+ r = write_string_file("/proc/sys/kernel/pid_max", buffer, 0);
115 if (r < 0)
116 return r;
117 }
118
119 sprintf(buffer, "%" PRIu64, limit);
120- r = write_string_file("/proc/sys/kernel/threads-max", buffer, WRITE_STRING_FILE_DISABLE_BUFFER);
121+ r = write_string_file("/proc/sys/kernel/threads-max", buffer, 0);
122 if (r < 0) {
123 uint64_t threads_max;
124
125diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c
126index 123d00e..e7ea78f 100644
127--- a/src/basic/smack-util.c
128+++ b/src/basic/smack-util.c
129@@ -115,7 +115,7 @@ int mac_smack_apply_pid(pid_t pid, const char *label) {
130 return 0;
131
132 p = procfs_file_alloca(pid, "attr/current");
133- r = write_string_file(p, label, WRITE_STRING_FILE_DISABLE_BUFFER);
134+ r = write_string_file(p, label, 0);
135 if (r < 0)
136 return r;
137
138diff --git a/src/basic/util.c b/src/basic/util.c
139index e577c93..3c64f91 100644
140--- a/src/basic/util.c
141+++ b/src/basic/util.c
142@@ -631,7 +631,7 @@ void disable_coredumps(void) {
143 if (detect_container() > 0)
144 return;
145
146- r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", WRITE_STRING_FILE_DISABLE_BUFFER);
147+ r = write_string_file("/proc/sys/kernel/core_pattern", "|/bin/false", 0);
148 if (r < 0)
149 log_debug_errno(r, "Failed to turn off coredumps, ignoring: %m");
150 }
151diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
152index af31f09..eec5738 100644
153--- a/src/binfmt/binfmt.c
154+++ b/src/binfmt/binfmt.c
155@@ -47,7 +47,7 @@ static int delete_rule(const char *rule) {
156 if (!fn)
157 return log_oom();
158
159- return write_string_file(fn, "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
160+ return write_string_file(fn, "-1", 0);
161 }
162
163 static int apply_rule(const char *rule) {
164@@ -55,7 +55,7 @@ static int apply_rule(const char *rule) {
165
166 (void) delete_rule(rule);
167
168- r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, WRITE_STRING_FILE_DISABLE_BUFFER);
169+ r = write_string_file("/proc/sys/fs/binfmt_misc/register", rule, 0);
170 if (r < 0)
171 return log_error_errno(r, "Failed to add binary format: %m");
172
173@@ -212,7 +212,7 @@ static int run(int argc, char *argv[]) {
174 }
175
176 /* Flush out all rules */
177- write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", WRITE_STRING_FILE_DISABLE_BUFFER);
178+ write_string_file("/proc/sys/fs/binfmt_misc/status", "-1", 0);
179
180 STRV_FOREACH(f, files) {
181 k = apply_file(*f, true);
182diff --git a/src/core/main.c b/src/core/main.c
183index 561f956..db6f113 100644
184--- a/src/core/main.c
185+++ b/src/core/main.c
186@@ -1468,7 +1468,7 @@ static int bump_unix_max_dgram_qlen(void) {
187 if (v >= DEFAULT_UNIX_MAX_DGRAM_QLEN)
188 return 0;
189
190- r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", WRITE_STRING_FILE_DISABLE_BUFFER, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
191+ r = write_string_filef("/proc/sys/net/unix/max_dgram_qlen", 0, "%lu", DEFAULT_UNIX_MAX_DGRAM_QLEN);
192 if (r < 0)
193 return log_full_errno(IN_SET(r, -EROFS, -EPERM, -EACCES) ? LOG_DEBUG : LOG_WARNING, r,
194 "Failed to bump AF_UNIX datagram queue length, ignoring: %m");
195@@ -1683,7 +1683,7 @@ static void initialize_core_pattern(bool skip_setup) {
196 if (getpid_cached() != 1)
197 return;
198
199- r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, WRITE_STRING_FILE_DISABLE_BUFFER);
200+ r = write_string_file("/proc/sys/kernel/core_pattern", arg_early_core_pattern, 0);
201 if (r < 0)
202 log_warning_errno(r, "Failed to write '%s' to /proc/sys/kernel/core_pattern, ignoring: %m", arg_early_core_pattern);
203 }
204diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
205index 49b37ae..c96eedc 100644
206--- a/src/core/smack-setup.c
207+++ b/src/core/smack-setup.c
208@@ -350,17 +350,17 @@ int mac_smack_setup(bool *loaded_policy) {
209 }
210
211 #ifdef SMACK_RUN_LABEL
212- r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
213+ r = write_string_file("/proc/self/attr/current", SMACK_RUN_LABEL, 0);
214 if (r < 0)
215 log_warning_errno(r, "Failed to set SMACK label \"" SMACK_RUN_LABEL "\" on self: %m");
216- r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
217+ r = write_string_file("/sys/fs/smackfs/ambient", SMACK_RUN_LABEL, 0);
218 if (r < 0)
219 log_warning_errno(r, "Failed to set SMACK ambient label \"" SMACK_RUN_LABEL "\": %m");
220 r = write_string_file("/sys/fs/smackfs/netlabel",
221- "0.0.0.0/0 " SMACK_RUN_LABEL, WRITE_STRING_FILE_DISABLE_BUFFER);
222+ "0.0.0.0/0 " SMACK_RUN_LABEL, 0);
223 if (r < 0)
224 log_warning_errno(r, "Failed to set SMACK netlabel rule \"0.0.0.0/0 " SMACK_RUN_LABEL "\": %m");
225- r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", WRITE_STRING_FILE_DISABLE_BUFFER);
226+ r = write_string_file("/sys/fs/smackfs/netlabel", "127.0.0.1 -CIPSO", 0);
227 if (r < 0)
228 log_warning_errno(r, "Failed to set SMACK netlabel rule \"127.0.0.1 -CIPSO\": %m");
229 #endif
230diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
231index 17e7cd1..87a7667 100644
232--- a/src/hibernate-resume/hibernate-resume.c
233+++ b/src/hibernate-resume/hibernate-resume.c
234@@ -45,7 +45,7 @@ int main(int argc, char *argv[]) {
235 return EXIT_FAILURE;
236 }
237
238- r = write_string_file("/sys/power/resume", major_minor, WRITE_STRING_FILE_DISABLE_BUFFER);
239+ r = write_string_file("/sys/power/resume", major_minor, 0);
240 if (r < 0) {
241 log_error_errno(r, "Failed to write '%s' to /sys/power/resume: %m", major_minor);
242 return EXIT_FAILURE;
243diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
244index 2a69f2e..9d55340 100644
245--- a/src/libsystemd/sd-device/sd-device.c
246+++ b/src/libsystemd/sd-device/sd-device.c
247@@ -1836,7 +1836,7 @@ _public_ int sd_device_set_sysattr_value(sd_device *device, const char *sysattr,
248 if (!value)
249 return -ENOMEM;
250
251- r = write_string_file(path, value, WRITE_STRING_FILE_DISABLE_BUFFER | WRITE_STRING_FILE_NOFOLLOW);
252+ r = write_string_file(path, value, 0 | WRITE_STRING_FILE_NOFOLLOW);
253 if (r < 0) {
254 if (r == -ELOOP)
255 return -EINVAL;
256diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
257index 8ab498f..d27ef9c 100644
258--- a/src/login/logind-dbus.c
259+++ b/src/login/logind-dbus.c
260@@ -1231,7 +1231,7 @@ static int trigger_device(Manager *m, sd_device *d) {
261 if (!t)
262 return -ENOMEM;
263
264- (void) write_string_file(t, "change", WRITE_STRING_FILE_DISABLE_BUFFER);
265+ (void) write_string_file(t, "change", 0);
266 }
267
268 return 0;
269diff --git a/src/network/networkd-ipv6-proxy-ndp.c b/src/network/networkd-ipv6-proxy-ndp.c
270index f594b27..c283cc3 100644
271--- a/src/network/networkd-ipv6-proxy-ndp.c
272+++ b/src/network/networkd-ipv6-proxy-ndp.c
273@@ -43,7 +43,7 @@ static int ipv6_proxy_ndp_set(Link *link) {
274 v = ipv6_proxy_ndp_is_needed(link);
275 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/proxy_ndp");
276
277- r = write_string_file(p, one_zero(v), WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
278+ r = write_string_file(p, one_zero(v), WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
279 if (r < 0)
280 log_link_warning_errno(link, r, "Cannot configure proxy NDP for interface: %m");
281
282diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
283index 22392d7..e0ed551 100644
284--- a/src/network/networkd-link.c
285+++ b/src/network/networkd-link.c
286@@ -274,7 +274,7 @@ static int link_enable_ipv6(Link *link) {
287
288 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/disable_ipv6");
289
290- r = write_string_file(p, one_zero(disabled), WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
291+ r = write_string_file(p, one_zero(disabled), WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
292 if (r < 0)
293 log_link_warning_errno(link, r, "Cannot %s IPv6 for interface %s: %m",
294 enable_disable(!disabled), link->ifname);
295@@ -1272,7 +1272,7 @@ static int link_set_proxy_arp(Link *link) {
296
297 p = strjoina("/proc/sys/net/ipv4/conf/", link->ifname, "/proxy_arp");
298
299- r = write_string_file(p, one_zero(link->network->proxy_arp), WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
300+ r = write_string_file(p, one_zero(link->network->proxy_arp), WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
301 if (r < 0)
302 log_link_warning_errno(link, r, "Cannot configure proxy ARP for interface: %m");
303
304@@ -2541,7 +2541,7 @@ static int link_set_ipv4_forward(Link *link) {
305 * primarily to keep IPv4 and IPv6 packet forwarding behaviour
306 * somewhat in sync (see below). */
307
308- r = write_string_file("/proc/sys/net/ipv4/ip_forward", "1", WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
309+ r = write_string_file("/proc/sys/net/ipv4/ip_forward", "1", WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
310 if (r < 0)
311 log_link_warning_errno(link, r, "Cannot turn on IPv4 packet forwarding, ignoring: %m");
312
313@@ -2563,7 +2563,7 @@ static int link_set_ipv6_forward(Link *link) {
314 * same behaviour there and also propagate the setting from
315 * one to all, to keep things simple (see above). */
316
317- r = write_string_file("/proc/sys/net/ipv6/conf/all/forwarding", "1", WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
318+ r = write_string_file("/proc/sys/net/ipv6/conf/all/forwarding", "1", WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
319 if (r < 0)
320 log_link_warning_errno(link, r, "Cannot configure IPv6 packet forwarding, ignoring: %m");
321
322@@ -2583,7 +2583,7 @@ static int link_set_ipv6_privacy_extensions(Link *link) {
323 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/use_tempaddr");
324 xsprintf(buf, "%u", (unsigned) link->network->ipv6_privacy_extensions);
325
326- r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
327+ r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
328 if (r < 0)
329 log_link_warning_errno(link, r, "Cannot configure IPv6 privacy extension for interface: %m");
330
331@@ -2607,7 +2607,7 @@ static int link_set_ipv6_accept_ra(Link *link) {
332 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/accept_ra");
333
334 /* We handle router advertisements ourselves, tell the kernel to GTFO */
335- r = write_string_file(p, "0", WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
336+ r = write_string_file(p, "0", WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
337 if (r < 0)
338 log_link_warning_errno(link, r, "Cannot disable kernel IPv6 accept_ra for interface: %m");
339
340@@ -2635,7 +2635,7 @@ static int link_set_ipv6_dad_transmits(Link *link) {
341 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/dad_transmits");
342 xsprintf(buf, "%i", link->network->ipv6_dad_transmits);
343
344- r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
345+ r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
346 if (r < 0)
347 log_link_warning_errno(link, r, "Cannot set IPv6 dad transmits for interface: %m");
348
349@@ -2663,7 +2663,7 @@ static int link_set_ipv6_hop_limit(Link *link) {
350 p = strjoina("/proc/sys/net/ipv6/conf/", link->ifname, "/hop_limit");
351 xsprintf(buf, "%i", link->network->ipv6_hop_limit);
352
353- r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | WRITE_STRING_FILE_DISABLE_BUFFER);
354+ r = write_string_file(p, buf, WRITE_STRING_FILE_VERIFY_ON_FAILURE | 0);
355 if (r < 0)
356 log_link_warning_errno(link, r, "Cannot set IPv6 hop limit for interface: %m");
357
358@@ -2689,7 +2689,7 @@ static int link_set_ipv6_mtu(Link *link) {
359
360 xsprintf(buf, "%" PRIu32, link->network->ipv6_mtu);
361
362- r = write_string_file(p, buf, WRITE_STRING_FILE_DISABLE_BUFFER);
363+ r = write_string_file(p, buf, 0);
364 if (r < 0)
365 log_link_warning_errno(link, r, "Cannot set IPv6 MTU for interface: %m");
366
367diff --git a/src/nspawn/nspawn-cgroup.c b/src/nspawn/nspawn-cgroup.c
368index 97fa092..b841f51 100644
369--- a/src/nspawn/nspawn-cgroup.c
370+++ b/src/nspawn/nspawn-cgroup.c
371@@ -123,7 +123,7 @@ int sync_cgroup(pid_t pid, CGroupUnified unified_requested, uid_t uid_shift) {
372 (void) mkdir_parents(fn, 0755);
373
374 sprintf(pid_string, PID_FMT, pid);
375- r = write_string_file(fn, pid_string, WRITE_STRING_FILE_DISABLE_BUFFER);
376+ r = write_string_file(fn, pid_string, 0);
377 if (r < 0) {
378 log_error_errno(r, "Failed to move process: %m");
379 goto finish;
380diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
381index e0c2d71..213790c 100644
382--- a/src/nspawn/nspawn.c
383+++ b/src/nspawn/nspawn.c
384@@ -2117,7 +2117,7 @@ static int reset_audit_loginuid(void) {
385 if (streq(p, "4294967295"))
386 return 0;
387
388- r = write_string_file("/proc/self/loginuid", "4294967295", WRITE_STRING_FILE_DISABLE_BUFFER);
389+ r = write_string_file("/proc/self/loginuid", "4294967295", 0);
390 if (r < 0) {
391 log_error_errno(r,
392 "Failed to reset audit login UID. This probably means that your kernel is too\n"
393@@ -3195,13 +3195,13 @@ static int setup_uid_map(pid_t pid) {
394
395 xsprintf(uid_map, "/proc/" PID_FMT "/uid_map", pid);
396 xsprintf(line, UID_FMT " " UID_FMT " " UID_FMT "\n", 0, arg_uid_shift, arg_uid_range);
397- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
398+ r = write_string_file(uid_map, line, 0);
399 if (r < 0)
400 return log_error_errno(r, "Failed to write UID map: %m");
401
402 /* We always assign the same UID and GID ranges */
403 xsprintf(uid_map, "/proc/" PID_FMT "/gid_map", pid);
404- r = write_string_file(uid_map, line, WRITE_STRING_FILE_DISABLE_BUFFER);
405+ r = write_string_file(uid_map, line, 0);
406 if (r < 0)
407 return log_error_errno(r, "Failed to write GID map: %m");
408
409diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
410index 5b7984a..bf818aa 100644
411--- a/src/sleep/sleep.c
412+++ b/src/sleep/sleep.c
413@@ -43,7 +43,7 @@ static int write_hibernate_location_info(void) {
414
415 /* if it's a swap partition, we just write the disk to /sys/power/resume */
416 if (streq(type, "partition")) {
417- r = write_string_file("/sys/power/resume", device, WRITE_STRING_FILE_DISABLE_BUFFER);
418+ r = write_string_file("/sys/power/resume", device, 0);
419 if (r < 0)
420 return log_debug_errno(r, "Faileed to write partitoin device to /sys/power/resume: %m");
421
422@@ -79,12 +79,12 @@ static int write_hibernate_location_info(void) {
423
424 offset = fiemap->fm_extents[0].fe_physical / page_size();
425 xsprintf(offset_str, "%" PRIu64, offset);
426- r = write_string_file("/sys/power/resume_offset", offset_str, WRITE_STRING_FILE_DISABLE_BUFFER);
427+ r = write_string_file("/sys/power/resume_offset", offset_str, 0);
428 if (r < 0)
429 return log_debug_errno(r, "Failed to write offset '%s': %m", offset_str);
430
431 xsprintf(device_str, "%lx", (unsigned long)stb.st_dev);
432- r = write_string_file("/sys/power/resume", device_str, WRITE_STRING_FILE_DISABLE_BUFFER);
433+ r = write_string_file("/sys/power/resume", device_str, 0);
434 if (r < 0)
435 return log_debug_errno(r, "Failed to write device '%s': %m", device_str);
436
437@@ -98,7 +98,7 @@ static int write_mode(char **modes) {
438 STRV_FOREACH(mode, modes) {
439 int k;
440
441- k = write_string_file("/sys/power/disk", *mode, WRITE_STRING_FILE_DISABLE_BUFFER);
442+ k = write_string_file("/sys/power/disk", *mode, 0);
443 if (k >= 0)
444 return 0;
445
446@@ -117,7 +117,7 @@ static int write_state(FILE **f, char **states) {
447 STRV_FOREACH(state, states) {
448 int k;
449
450- k = write_string_stream(*f, *state, WRITE_STRING_FILE_DISABLE_BUFFER);
451+ k = write_string_stream(*f, *state, 0);
452 if (k >= 0)
453 return 0;
454 log_debug_errno(k, "Failed to write '%s' to /sys/power/state: %m", *state);
455@@ -212,7 +212,7 @@ static int rtc_write_wake_alarm(uint64_t sec) {
456
457 xsprintf(buf, "%" PRIu64, sec);
458
459- r = write_string_file("/sys/class/rtc/rtc0/wakealarm", buf, WRITE_STRING_FILE_DISABLE_BUFFER);
460+ r = write_string_file("/sys/class/rtc/rtc0/wakealarm", buf, 0);
461 if (r < 0)
462 return log_error_errno(r, "Failed to write '%s' to /sys/class/rtc/rtc0/wakealarm: %m", buf);
463
464diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
465index 9532946..2e576bb 100644
466--- a/src/udev/udevadm-trigger.c
467+++ b/src/udev/udevadm-trigger.c
468@@ -42,7 +42,7 @@ static int exec_list(sd_device_enumerator *e, const char *action, Set *settle_se
469 if (!filename)
470 return log_oom();
471
472- r = write_string_file(filename, action, WRITE_STRING_FILE_DISABLE_BUFFER);
473+ r = write_string_file(filename, action, 0);
474 if (r < 0) {
475 log_debug_errno(r, "Failed to write '%s' to '%s', ignoring: %m", action, filename);
476 continue;
477diff --git a/src/udev/udevd.c b/src/udev/udevd.c
478index 0303f36..687d009 100644
479--- a/src/udev/udevd.c
480+++ b/src/udev/udevd.c
481@@ -1218,7 +1218,7 @@ static int synthesize_change(sd_device *dev) {
482 */
483 log_debug("Device '%s' is closed, synthesising 'change'", devname);
484 strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL);
485- write_string_file(filename, "change", WRITE_STRING_FILE_DISABLE_BUFFER);
486+ write_string_file(filename, "change", 0);
487
488 FOREACH_DEVICE(e, d) {
489 const char *t, *n, *s;
490@@ -1233,7 +1233,7 @@ static int synthesize_change(sd_device *dev) {
491
492 log_debug("Device '%s' is closed, synthesising partition '%s' 'change'", devname, n);
493 strscpyl(filename, sizeof(filename), s, "/uevent", NULL);
494- write_string_file(filename, "change", WRITE_STRING_FILE_DISABLE_BUFFER);
495+ write_string_file(filename, "change", 0);
496 }
497
498 return 0;
499@@ -1241,7 +1241,7 @@ static int synthesize_change(sd_device *dev) {
500
501 log_debug("Device %s is closed, synthesising 'change'", devname);
502 strscpyl(filename, sizeof(filename), syspath, "/uevent", NULL);
503- write_string_file(filename, "change", WRITE_STRING_FILE_DISABLE_BUFFER);
504+ write_string_file(filename, "change", 0);
505
506 return 0;
507 }
508diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
509index ebdeba3..aa879e6 100644
510--- a/src/vconsole/vconsole-setup.c
511+++ b/src/vconsole/vconsole-setup.c
512@@ -114,7 +114,7 @@ static int toggle_utf8(const char *name, int fd, bool utf8) {
513 static int toggle_utf8_sysfs(bool utf8) {
514 int r;
515
516- r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), WRITE_STRING_FILE_DISABLE_BUFFER);
517+ r = write_string_file("/sys/module/vt/parameters/default_utf8", one_zero(utf8), 0);
518 if (r < 0)
519 return log_warning_errno(r, "Failed to %s sysfs UTF-8 flag: %m", enable_disable(utf8));
520
521--
5222.7.4
523
diff --git a/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch b/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
deleted file mode 100644
index ba08e34558..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-login-use-parse_uid-when-unmounting-user-runtime-dir.patch
+++ /dev/null
@@ -1,110 +0,0 @@
1From 86d18f3b09ec984ef3732567af992adb2dc77a8a Mon Sep 17 00:00:00 2001
2From: Yu Watanabe <watanabe.yu+github@gmail.com>
3Date: Mon, 9 Jul 2018 14:05:20 +0900
4Subject: [PATCH] login: use parse_uid() when unmounting user runtime directory
5
6When unmounting user runtime directory, only UID is necessary,
7and the corresponding user may not exist anymore.
8This makes first try to parse the input by parse_uid(), and only if it
9fails, prase the input by get_user_creds().
10
11Fixes #9541.
12
13Upstream-Status: Backport
14---
15 src/login/user-runtime-dir.c | 57 ++++++++++++++++++++++++++++----------------
16 1 file changed, 36 insertions(+), 21 deletions(-)
17
18diff --git a/src/login/user-runtime-dir.c b/src/login/user-runtime-dir.c
19index 1bb26c99e..de4061c75 100644
20--- a/src/login/user-runtime-dir.c
21+++ b/src/login/user-runtime-dir.c
22@@ -111,8 +111,22 @@ static int user_remove_runtime_path(const char *runtime_path) {
23 return r;
24 }
25
26-static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
27+static int do_mount(const char *user) {
28+ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
29 size_t runtime_dir_size;
30+ uid_t uid;
31+ gid_t gid;
32+ int r;
33+
34+ r = get_user_creds(&user, &uid, &gid, NULL, NULL);
35+ if (r < 0)
36+ return log_error_errno(r,
37+ r == -ESRCH ? "No such user \"%s\"" :
38+ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
39+ : "Failed to look up user \"%s\": %m",
40+ user);
41+
42+ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
43
44 assert_se(gather_configuration(&runtime_dir_size) == 0);
45
46@@ -120,16 +134,30 @@ static int do_mount(const char *runtime_path, uid_t uid, gid_t gid) {
47 return user_mkdir_runtime_path(runtime_path, uid, gid, runtime_dir_size);
48 }
49
50-static int do_umount(const char *runtime_path) {
51+static int do_umount(const char *user) {
52+ char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
53+ uid_t uid;
54+ int r;
55+
56+ /* The user may be already removed. So, first try to parse the string by parse_uid(),
57+ * and if it fails, fallback to get_user_creds().*/
58+ if (parse_uid(user, &uid) < 0) {
59+ r = get_user_creds(&user, &uid, NULL, NULL, NULL);
60+ if (r < 0)
61+ return log_error_errno(r,
62+ r == -ESRCH ? "No such user \"%s\"" :
63+ r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
64+ : "Failed to look up user \"%s\": %m",
65+ user);
66+ }
67+
68+ xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
69+
70 log_debug("Will remove %s", runtime_path);
71 return user_remove_runtime_path(runtime_path);
72 }
73
74 int main(int argc, char *argv[]) {
75- const char *user;
76- uid_t uid;
77- gid_t gid;
78- char runtime_path[sizeof("/run/user") + DECIMAL_STR_MAX(uid_t)];
79 int r;
80
81 log_parse_environment();
82@@ -146,23 +174,10 @@ int main(int argc, char *argv[]) {
83
84 umask(0022);
85
86- user = argv[2];
87- r = get_user_creds(&user, &uid, &gid, NULL, NULL);
88- if (r < 0) {
89- log_error_errno(r,
90- r == -ESRCH ? "No such user \"%s\"" :
91- r == -ENOMSG ? "UID \"%s\" is invalid or has an invalid main group"
92- : "Failed to look up user \"%s\": %m",
93- user);
94- return EXIT_FAILURE;
95- }
96-
97- xsprintf(runtime_path, "/run/user/" UID_FMT, uid);
98-
99 if (streq(argv[1], "start"))
100- r = do_mount(runtime_path, uid, gid);
101+ r = do_mount(argv[2]);
102 else if (streq(argv[1], "stop"))
103- r = do_umount(runtime_path);
104+ r = do_umount(argv[2]);
105 else
106 assert_not_reached("Unknown verb!");
107
108--
1092.11.0
110
diff --git a/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch b/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch
deleted file mode 100644
index d6d305cb37..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-meson-rename-Ddebug-to-Ddebug-extra.patch
+++ /dev/null
@@ -1,45 +0,0 @@
1From 8f6b442a78d0b485f044742ad90b2e8271b4e68e Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Sun, 19 Aug 2018 19:11:30 +0200
4Subject: [PATCH] meson: rename -Ddebug to -Ddebug-extra
5
6Meson added -Doptimization and -Ddebug options, which obviously causes
7a conflict with our -Ddebug options. Let's rename it.
8
9Fixes #9883.
10Upstream-Status: Backport
11Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
12---
13 meson.build | 2 +-
14 meson_options.txt | 2 +-
15 2 files changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/meson.build b/meson.build
18index f79ac4b12..2209c935a 100644
19--- a/meson.build
20+++ b/meson.build
21@@ -763,7 +763,7 @@ substs.set('DEBUGTTY', get_option('debug-tty'))
22
23 enable_debug_hashmap = false
24 enable_debug_mmap_cache = false
25-foreach name : get_option('debug')
26+foreach name : get_option('debug-extra')
27 if name == 'hashmap'
28 enable_debug_hashmap = true
29 elif name == 'mmap-cache'
30diff --git a/meson_options.txt b/meson_options.txt
31index e3140c8c1..7b1f61bf4 100644
32--- a/meson_options.txt
33+++ b/meson_options.txt
34@@ -45,7 +45,7 @@ option('debug-shell', type : 'string', value : '/bin/sh',
35 description : 'path to debug shell binary')
36 option('debug-tty', type : 'string', value : '/dev/tty9',
37 description : 'specify the tty device for debug shell')
38-option('debug', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [],
39+option('debug-extra', type : 'array', choices : ['hashmap', 'mmap-cache'], value : [],
40 description : 'enable extra debugging')
41 option('memory-accounting-default', type : 'boolean',
42 description : 'enable MemoryAccounting= by default')
43--
442.17.1
45
diff --git a/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch b/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch
deleted file mode 100644
index 45c9b5b1e3..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-sd-bus-make-BUS_DEFAULT_TIMEOUT-configurable.patch
+++ /dev/null
@@ -1,175 +0,0 @@
1From 5b75a72ee968c9666b5f2ea313720b6c383cb4c2 Mon Sep 17 00:00:00 2001
2From: Yu Watanabe <watanabe.yu+github@gmail.com>
3Date: Fri, 13 Jul 2018 17:38:47 +0900
4Subject: [PATCH] sd-bus: make BUS_DEFAULT_TIMEOUT configurable
5
6This adds sd_bus_{get,set}_method_call_timeout().
7If the timeout is not set or set to 0, then the timeout value is
8parsed from $SYSTEMD_BUS_TIMEOUT= environment variable. If the
9environment variable is not set, then built-in timeout is used.
10---
11 doc/ENVIRONMENT.md | 5 +++++
12 src/libsystemd/libsystemd.sym | 5 +++++
13 src/libsystemd/sd-bus/bus-internal.h | 9 ++++----
14 src/libsystemd/sd-bus/bus-message.c | 7 +++++--
15 src/libsystemd/sd-bus/sd-bus.c | 40 ++++++++++++++++++++++++++++++++++--
16 src/systemd/sd-bus.h | 3 +++
17 6 files changed, 61 insertions(+), 8 deletions(-)
18
19Upstream-Status: Backport
20
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22
23diff --git a/doc/ENVIRONMENT.md b/doc/ENVIRONMENT.md
24index 85d26fe28c..641a03d5d7 100644
25--- a/doc/ENVIRONMENT.md
26+++ b/doc/ENVIRONMENT.md
27@@ -37,6 +37,11 @@ All tools:
28 useful for debugging, in order to test generators and other code against
29 specific kernel command lines.
30
31+* `$SYSTEMD_BUS_TIMEOUT=SECS` — specifies the maximum time to wait for method call
32+ completion. If no time unit is specified, assumes seconds. The usual other units
33+ are understood, too (us, ms, s, min, h, d, w, month, y). If it is not set or set
34+ to 0, then the built-in default is used.
35+
36 systemctl:
37
38 * `$SYSTEMCTL_FORCE_BUS=1` — if set, do not connect to PID1's private D-Bus
39diff --git a/src/libsystemd/libsystemd.sym b/src/libsystemd/libsystemd.sym
40index 1eec17db50..006dbc9c3f 100644
41--- a/src/libsystemd/libsystemd.sym
42+++ b/src/libsystemd/libsystemd.sym
43@@ -570,3 +570,8 @@ global:
44 sd_event_source_set_destroy_callback;
45 sd_event_source_get_destroy_callback;
46 } LIBSYSTEMD_238;
47+
48+LIBSYSTEMD_240 {
49+ sd_bus_set_method_call_timeout;
50+ sd_bus_get_method_call_timeout;
51+} LIBSYSTEMD_239;
52diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
53index 2087ef8eeb..4864b1e911 100644
54--- a/src/libsystemd/sd-bus/bus-internal.h
55+++ b/src/libsystemd/sd-bus/bus-internal.h
56@@ -319,6 +319,9 @@ struct sd_bus {
57
58 int *inotify_watches;
59 size_t n_inotify_watches;
60+
61+ /* zero means use value specified by $SYSTEMD_BUS_TIMEOUT= environment variable or built-in default */
62+ usec_t method_call_timeout;
63 };
64
65 /* For method calls we time-out at 25s, like in the D-Bus reference implementation */
66@@ -336,8 +339,7 @@ struct sd_bus {
67
68 #define BUS_CONTAINER_DEPTH 128
69
70-/* Defined by the specification as maximum size of an array in
71- * bytes */
72+/* Defined by the specification as maximum size of an array in bytes */
73 #define BUS_ARRAY_MAX_SIZE 67108864
74
75 #define BUS_FDS_MAX 1024
76@@ -388,8 +390,7 @@ void bus_close_io_fds(sd_bus *b);
77 _slash = streq((prefix), "/") ? NULL : strrchr((prefix), '/'))
78
79 /* If we are invoking callbacks of a bus object, ensure unreffing the
80- * bus from the callback doesn't destroy the object we are working
81- * on */
82+ * bus from the callback doesn't destroy the object we are working on */
83 #define BUS_DONT_DESTROY(bus) \
84 _cleanup_(sd_bus_unrefp) _unused_ sd_bus *_dont_destroy_##bus = sd_bus_ref(bus)
85
86diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
87index 8d92bc2002..dffe70a665 100644
88--- a/src/libsystemd/sd-bus/bus-message.c
89+++ b/src/libsystemd/sd-bus/bus-message.c
90@@ -5809,8 +5809,11 @@ int bus_message_remarshal(sd_bus *bus, sd_bus_message **m) {
91 return r;
92
93 timeout = (*m)->timeout;
94- if (timeout == 0 && !((*m)->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED))
95- timeout = BUS_DEFAULT_TIMEOUT;
96+ if (timeout == 0 && !((*m)->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED)) {
97+ r = sd_bus_get_method_call_timeout(bus, &timeout);
98+ if (r < 0)
99+ return r;
100+ }
101
102 r = sd_bus_message_seal(n, BUS_MESSAGE_COOKIE(*m), timeout);
103 if (r < 0)
104diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
105index 089b51a6d9..945490ebf7 100644
106--- a/src/libsystemd/sd-bus/sd-bus.c
107+++ b/src/libsystemd/sd-bus/sd-bus.c
108@@ -1611,8 +1611,11 @@ static int bus_seal_message(sd_bus *b, sd_bus_message *m, usec_t timeout) {
109 return 0;
110 }
111
112- if (timeout == 0)
113- timeout = BUS_DEFAULT_TIMEOUT;
114+ if (timeout == 0) {
115+ r = sd_bus_get_method_call_timeout(b, &timeout);
116+ if (r < 0)
117+ return r;
118+ }
119
120 if (!m->sender && b->patch_sender) {
121 r = sd_bus_message_set_sender(m, b->patch_sender);
122@@ -4075,3 +4078,36 @@ _public_ int sd_bus_get_n_queued_write(sd_bus *bus, uint64_t *ret) {
123 *ret = bus->wqueue_size;
124 return 0;
125 }
126+
127+_public_ int sd_bus_set_method_call_timeout(sd_bus *bus, uint64_t usec) {
128+ assert_return(bus, -EINVAL);
129+ assert_return(bus = bus_resolve(bus), -ENOPKG);
130+
131+ bus->method_call_timeout = usec;
132+ return 0;
133+}
134+
135+_public_ int sd_bus_get_method_call_timeout(sd_bus *bus, uint64_t *ret) {
136+ const char *e;
137+ usec_t usec;
138+
139+ assert_return(bus, -EINVAL);
140+ assert_return(bus = bus_resolve(bus), -ENOPKG);
141+ assert_return(ret, -EINVAL);
142+
143+ if (bus->method_call_timeout != 0) {
144+ *ret = bus->method_call_timeout;
145+ return 0;
146+ }
147+
148+ e = secure_getenv("SYSTEMD_BUS_TIMEOUT");
149+ if (e && parse_sec(e, &usec) >= 0 && usec != 0) {
150+ /* Save the parsed value to avoid multiple parsing. To change the timeout value,
151+ * use sd_bus_set_method_call_timeout() instead of setenv(). */
152+ *ret = bus->method_call_timeout = usec;
153+ return 0;
154+ }
155+
156+ *ret = bus->method_call_timeout = BUS_DEFAULT_TIMEOUT;
157+ return 0;
158+}
159diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h
160index 54c4b1ca83..c9fd254834 100644
161--- a/src/systemd/sd-bus.h
162+++ b/src/systemd/sd-bus.h
163@@ -206,6 +206,9 @@ sd_event *sd_bus_get_event(sd_bus *bus);
164 int sd_bus_get_n_queued_read(sd_bus *bus, uint64_t *ret);
165 int sd_bus_get_n_queued_write(sd_bus *bus, uint64_t *ret);
166
167+int sd_bus_set_method_call_timeout(sd_bus *bus, uint64_t usec);
168+int sd_bus_get_method_call_timeout(sd_bus *bus, uint64_t *ret);
169+
170 int sd_bus_add_filter(sd_bus *bus, sd_bus_slot **slot, sd_bus_message_handler_t callback, void *userdata);
171 int sd_bus_add_match(sd_bus *bus, sd_bus_slot **slot, const char *match, sd_bus_message_handler_t callback, void *userdata);
172 int sd_bus_add_match_async(sd_bus *bus, sd_bus_slot **slot, const char *match, sd_bus_message_handler_t callback, sd_bus_message_handler_t install_callback, void *userdata);
173--
1742.11.0
175
diff --git a/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch b/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch
deleted file mode 100644
index 0538c7bbc8..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch
+++ /dev/null
@@ -1,31 +0,0 @@
1From bfc4183ea995f1c211385d066cdb1fe9ce89f621 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 16 Dec 2018 20:53:38 -0800
4Subject: [PATCH 1/2] sysctl: Don't pass null directive argument to '%s'
5
6value pointer here is always NULL but subsequent use of that pointer
7with a %s format will always be NULL, printing p instead would be a
8valid string
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/11179]
13 src/sysctl/sysctl.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/sysctl/sysctl.c b/src/sysctl/sysctl.c
17index 1cfe51018..c67d79032 100644
18--- a/src/sysctl/sysctl.c
19+++ b/src/sysctl/sysctl.c
20@@ -115,7 +115,7 @@ static int parse_file(OrderedHashmap *sysctl_options, const char *path, bool ign
21
22 value = strchr(p, '=');
23 if (!value) {
24- log_error("Line is not an assignment at '%s:%u': %s", path, c, value);
25+ log_error("Line is not an assignment at '%s:%u': %s", path, c, p);
26
27 if (r == 0)
28 r = -EINVAL;
29--
302.20.1
31
diff --git a/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch b/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch
deleted file mode 100644
index 8d395c2fa3..0000000000
--- a/meta/recipes-core/systemd/systemd/0001-timesync-changes-type-of-drift_freq-to-int64_t.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1Backport patch to fix systemd build failure on x32.
2
3Upstream-Status: Backport [https://github.com/systemd/systemd/commit/75ca162]
4
5Signed-off-by: Kai Kang <kai.kang@windriver.com>
6
7From 75ca1621db4647a4d62d7873cd6715e28fe0f9fa Mon Sep 17 00:00:00 2001
8From: Yu Watanabe <watanabe.yu+github@gmail.com>
9Date: Sat, 23 Jun 2018 09:41:55 +0900
10Subject: [PATCH] timesync: changes type of drift_freq to int64_t
11
12drift_freq is used for storing timex.freq, and is a 64bit integer.
13To support x32 ABI, this changes the type of drift_freq to int64_t.
14
15Fixes #9387.
16---
17 src/timesync/timesyncd-manager.c | 2 +-
18 src/timesync/timesyncd-manager.h | 2 +-
19 2 files changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
22index 2b731af9e..404a2b189 100644
23--- a/src/timesync/timesyncd-manager.c
24+++ b/src/timesync/timesyncd-manager.c
25@@ -604,7 +604,7 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
26 m->dest_time = *recv_time;
27 m->spike = spike;
28
29- log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRI_TIMEX"ppm%s",
30+ log_debug("interval/delta/delay/jitter/drift " USEC_FMT "s/%+.3fs/%.3fs/%.3fs/%+"PRIi64"ppm%s",
31 m->poll_interval_usec / USEC_PER_SEC, offset, delay, m->samples_jitter, m->drift_freq / 65536,
32 spike ? " (ignored)" : "");
33
34diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
35index d8d97cc1e..18347416d 100644
36--- a/src/timesync/timesyncd-manager.h
37+++ b/src/timesync/timesyncd-manager.h
38@@ -79,7 +79,7 @@ struct Manager {
39 /* last change */
40 bool jumped;
41 bool sync;
42- long drift_freq;
43+ int64_t drift_freq;
44
45 /* watch for time changes */
46 sd_event_source *event_clock_watch;
47--
482.17.0
49
diff --git a/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch b/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch
deleted file mode 100644
index 4da96e2920..0000000000
--- a/meta/recipes-core/systemd/systemd/0002-core-Fix-use-after-free-case-in-load_from_path.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From cb67aebd63d9f0077cbf3e769f0b223c5bba20ac Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 16 Dec 2018 20:58:35 -0800
4Subject: [PATCH 2/2] core: Fix use after free case in load_from_path()
5
6ensure that mfree() on filename is called after the logging function
7which uses the string pointed by filename
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/11179]
12 src/core/load-fragment.c | 6 ++++--
13 1 file changed, 4 insertions(+), 2 deletions(-)
14
15diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
16index fc5644f48..da585786e 100644
17--- a/src/core/load-fragment.c
18+++ b/src/core/load-fragment.c
19@@ -4531,7 +4531,6 @@ static int load_from_path(Unit *u, const char *path) {
20 r = open_follow(&filename, &f, symlink_names, &id);
21 if (r >= 0)
22 break;
23- filename = mfree(filename);
24
25 /* ENOENT means that the file is missing or is a dangling symlink.
26 * ENOTDIR means that one of paths we expect to be is a directory
27@@ -4540,9 +4539,12 @@ static int load_from_path(Unit *u, const char *path) {
28 */
29 if (r == -EACCES)
30 log_debug_errno(r, "Cannot access \"%s\": %m", filename);
31- else if (!IN_SET(r, -ENOENT, -ENOTDIR))
32+ else if (!IN_SET(r, -ENOENT, -ENOTDIR)) {
33+ filename = mfree(filename);
34 return r;
35+ }
36
37+ filename = mfree(filename);
38 /* Empty the symlink names for the next run */
39 set_clear_free(symlink_names);
40 }
41--
422.20.1
43
diff --git a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
index 8e0d669e83..36e0699da9 100644
--- a/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
+++ b/meta/recipes-core/systemd/systemd/0002-don-t-use-glibc-specific-qsort_r.patch
@@ -1,31 +1,100 @@
1From d74a4de6daea5a511c2b5636bbb552c15b3a4ad9 Mon Sep 17 00:00:00 2001 1From 1eb84534dea05d41afed1d898cba212ad7d310dd Mon Sep 17 00:00:00 2001
2From: Emil Renner Berthing <systemd@esmil.dk> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 18 Sep 2014 15:24:56 +0200 3Date: Mon, 25 Feb 2019 13:41:41 +0800
4Subject: [PATCH] don't use glibc-specific qsort_r 4Subject: [PATCH 02/24] don't use glibc-specific qsort_r
5 5
6Upstream-Status: Inappropriate [musl specific] 6Upstream-Status: Inappropriate [musl specific]
7 7
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9[Rebased for v241]
10Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9--- 11---
10 src/basic/format-table.c | 27 ++++++++++++++++----------- 12 src/basic/util.h | 14 --------------
11 src/basic/util.h | 7 ------- 13 src/libsystemd/sd-hwdb/hwdb-util.c | 19 ++++++++++++++-----
12 src/hwdb/hwdb.c | 18 +++++++++++------- 14 src/shared/format-table.c | 36 ++++++++++++++++++++++++------------
13 src/udev/udevadm-hwdb.c | 16 ++++++++++------ 15 3 files changed, 38 insertions(+), 31 deletions(-)
14 4 files changed, 37 insertions(+), 31 deletions(-)
15 16
16diff --git a/src/basic/format-table.c b/src/basic/format-table.c 17diff --git a/src/basic/util.h b/src/basic/util.h
17index 94e796d1ca..9b3f35c29a 100644 18index dc33d66..9f6a6ce 100644
18--- a/src/basic/format-table.c 19--- a/src/basic/util.h
19+++ b/src/basic/format-table.c 20+++ b/src/basic/util.h
20@@ -745,29 +745,29 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t 21@@ -116,20 +116,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, __compar_fn
22 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
23 })
24
25-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, __compar_d_fn_t compar, void *userdata) {
26- if (nmemb <= 1)
27- return;
28-
29- assert(base);
30- qsort_r(base, nmemb, size, compar, userdata);
31-}
32-
33-#define typesafe_qsort_r(p, n, func, userdata) \
34- ({ \
35- int (*_func_)(const typeof(p[0])*, const typeof(p[0])*, typeof(userdata)) = func; \
36- qsort_r_safe((p), (n), sizeof((p)[0]), (__compar_d_fn_t) _func_, userdata); \
37- })
38-
39 /* Normal memcpy requires src to be nonnull. We do nothing if n is 0. */
40 static inline void memcpy_safe(void *dst, const void *src, size_t n) {
41 if (n == 0)
42diff --git a/src/libsystemd/sd-hwdb/hwdb-util.c b/src/libsystemd/sd-hwdb/hwdb-util.c
43index f852967..b570ce1 100644
44--- a/src/libsystemd/sd-hwdb/hwdb-util.c
45+++ b/src/libsystemd/sd-hwdb/hwdb-util.c
46@@ -126,9 +126,13 @@ static void trie_free(struct trie *trie) {
47
48 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
49
50-static int trie_values_cmp(const struct trie_value_entry *a, const struct trie_value_entry *b, struct trie *trie) {
51- return strcmp(trie->strings->buf + a->key_off,
52- trie->strings->buf + b->key_off);
53+static struct trie *trie_node_add_value_trie;
54+static int trie_values_cmp(const void *v1, const void *v2) {
55+ const struct trie_value_entry *a = v1;
56+ const struct trie_value_entry *b = v2;
57+
58+ return strcmp(trie_node_add_value_trie->strings->buf + a->key_off,
59+ trie_node_add_value_trie->strings->buf + b->key_off);
60 }
61
62 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
63@@ -156,7 +160,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
64 .value_off = v,
65 };
66
67- val = typesafe_bsearch_r(&search, node->values, node->values_count, trie_values_cmp, trie);
68+ trie_node_add_value_trie = trie;
69+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
70+ trie_node_add_value_trie = NULL;
71+
72 if (val) {
73 /* At this point we have 2 identical properties on the same match-string.
74 * Since we process files in order, we just replace the previous value. */
75@@ -182,7 +189,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
76 .line_number = line_number,
77 };
78 node->values_count++;
79- typesafe_qsort_r(node->values, node->values_count, trie_values_cmp, trie);
80+ trie_node_add_value_trie = trie;
81+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
82+ trie_node_add_value_trie = NULL;
21 return 0; 83 return 0;
22 } 84 }
23 85
24-static int table_data_compare(const void *x, const void *y, void *userdata) { 86diff --git a/src/shared/format-table.c b/src/shared/format-table.c
87index 7d52980..75dbfe1 100644
88--- a/src/shared/format-table.c
89+++ b/src/shared/format-table.c
90@@ -848,31 +848,33 @@ static int cell_data_compare(TableData *a, size_t index_a, TableData *b, size_t
91 return CMP(index_a, index_b);
92 }
93
94-static int table_data_compare(const size_t *a, const size_t *b, Table *t) {
25+static Table *user_table; 95+static Table *user_table;
26+static int table_data_compare(const void *x, const void *y) { 96+static int table_data_compare(const void *x, const void *y) {
27 const size_t *a = x, *b = y; 97+ const size_t *a = x, *b=y;
28- Table *t = userdata;
29 size_t i; 98 size_t i;
30 int r; 99 int r;
31 100
@@ -57,11 +126,16 @@ index 94e796d1ca..9b3f35c29a 100644
57 126
58 r = cell_data_compare(d, *a, dd, *b); 127 r = cell_data_compare(d, *a, dd, *b);
59 if (r != 0) 128 if (r != 0)
60@@ -960,7 +960,12 @@ int table_print(Table *t, FILE *f) { 129- return t->reverse_map && t->reverse_map[t->sort_map[i]] ? -r : r;
130+ return user_table->reverse_map && user_table->reverse_map[user_table->sort_map[i]] ? -r : r;
131 }
132
133 /* Order identical lines by the order there were originally added in */
134@@ -1105,7 +1107,12 @@ int table_print(Table *t, FILE *f) {
61 for (i = 0; i < n_rows; i++) 135 for (i = 0; i < n_rows; i++)
62 sorted[i] = i * t->n_columns; 136 sorted[i] = i * t->n_columns;
63 137
64- qsort_r_safe(sorted, n_rows, sizeof(size_t), table_data_compare, t); 138- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
65+ if (n_rows <= 1) 139+ if (n_rows <= 1)
66+ return 0; 140+ return 0;
67+ assert(sorted); 141+ assert(sorted);
@@ -71,113 +145,20 @@ index 94e796d1ca..9b3f35c29a 100644
71 } 145 }
72 146
73 if (t->display_map) 147 if (t->display_map)
74diff --git a/src/basic/util.h b/src/basic/util.h 148@@ -1532,7 +1539,12 @@ int table_to_json(Table *t, JsonVariant **ret) {
75index 9699d228f9..40eaf518cb 100644 149 for (i = 0; i < n_rows; i++)
76--- a/src/basic/util.h 150 sorted[i] = i * t->n_columns;
77+++ b/src/basic/util.h
78@@ -105,13 +105,6 @@ static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_
79 qsort_safe((p), (n), sizeof((p)[0]), (__compar_fn_t) _func_); \
80 })
81
82-static inline void qsort_r_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void*, const void*, void*), void *userdata) {
83- if (nmemb <= 1)
84- return;
85-
86- assert(base);
87- qsort_r(base, nmemb, size, compar, userdata);
88-}
89
90 /**
91 * Normal memcpy requires src to be nonnull. We do nothing if n is 0.
92diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
93index 317cad8a67..701d59a1eb 100644
94--- a/src/hwdb/hwdb.c
95+++ b/src/hwdb/hwdb.c
96@@ -135,13 +135,12 @@ static void trie_free(struct trie *trie) {
97
98 DEFINE_TRIVIAL_CLEANUP_FUNC(struct trie*, trie_free);
99
100-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
101+static struct trie *trie_node_add_value_trie;
102+static int trie_values_cmp(const void *v1, const void *v2) {
103 const struct trie_value_entry *val1 = v1;
104 const struct trie_value_entry *val2 = v2;
105- struct trie *trie = arg;
106-
107- return strcmp(trie->strings->buf + val1->key_off,
108- trie->strings->buf + val2->key_off);
109+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
110+ trie_node_add_value_trie->strings->buf + val2->key_off);
111 }
112
113 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
114@@ -166,7 +165,10 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
115 .value_off = v,
116 };
117
118- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
119+ trie_node_add_value_trie = trie;
120+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
121+ trie_node_add_value_trie = NULL;
122+
123 if (val) {
124 /* At this point we have 2 identical properties on the same match-string.
125 * Since we process files in order, we just replace the previous value.
126@@ -191,7 +193,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
127 node->values[node->values_count].file_priority = file_priority;
128 node->values[node->values_count].line_number = line_number;
129 node->values_count++;
130- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
131+ trie_node_add_value_trie = trie;
132+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
133+ trie_node_add_value_trie = NULL;
134 return 0;
135 }
136
137diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
138index 02408a4285..491d367d12 100644
139--- a/src/udev/udevadm-hwdb.c
140+++ b/src/udev/udevadm-hwdb.c
141@@ -114,13 +114,13 @@ static void trie_node_cleanup(struct trie_node *node) {
142 free(node);
143 }
144
145-static int trie_values_cmp(const void *v1, const void *v2, void *arg) {
146+static struct trie *trie_node_add_value_trie;
147+static int trie_values_cmp(const void *v1, const void *v2) {
148 const struct trie_value_entry *val1 = v1;
149 const struct trie_value_entry *val2 = v2;
150- struct trie *trie = arg;
151
152- return strcmp(trie->strings->buf + val1->key_off,
153- trie->strings->buf + val2->key_off);
154+ return strcmp(trie_node_add_value_trie->strings->buf + val1->key_off,
155+ trie_node_add_value_trie->strings->buf + val2->key_off);
156 }
157
158 static int trie_node_add_value(struct trie *trie, struct trie_node *node,
159@@ -141,7 +141,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node,
160 .value_off = v,
161 };
162 151
163- val = xbsearch_r(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie); 152- typesafe_qsort_r(sorted, n_rows, table_data_compare, t);
164+ trie_node_add_value_trie = trie; 153+ if (n_rows <= 1)
165+ val = bsearch(&search, node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp); 154+ return 0;
166+ trie_node_add_value_trie = NULL; 155+ assert(sorted);
167 if (val) { 156+ user_table = t;
168 /* replace existing earlier key with new value */ 157+ qsort(sorted, n_rows, sizeof(size_t), table_data_compare);
169 val->value_off = v; 158+ user_table = NULL;
170@@ -158,7 +160,9 @@ static int trie_node_add_value(struct trie *trie, struct trie_node *node, 159 }
171 node->values[node->values_count].key_off = k;
172 node->values[node->values_count].value_off = v;
173 node->values_count++;
174- qsort_r(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp, trie);
175+ trie_node_add_value_trie = trie;
176+ qsort(node->values, node->values_count, sizeof(struct trie_value_entry), trie_values_cmp);
177+ trie_node_add_value_trie = NULL;
178 return 0;
179 }
180 160
161 if (t->display_map)
181-- 162--
1822.18.0 1632.7.4
183 164
diff --git a/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch b/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
index 1d7f5230a9..df5506cc2b 100644
--- a/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
+++ b/meta/recipes-core/systemd/systemd/0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch
@@ -1,7 +1,7 @@
1From 6e62be87a2722fbe531310a1b052c1301bdf06fb Mon Sep 17 00:00:00 2001 1From bdbafe18c3bf99b3b691cd52b9ccff60f313892d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 27 Jun 2018 16:09:24 +0800 3Date: Wed, 27 Jun 2018 16:09:24 +0800
4Subject: [PATCH 2/9] use lnr wrapper instead of looking for --relative option 4Subject: [PATCH 2/5] use lnr wrapper instead of looking for --relative option
5 for ln 5 for ln
6 6
7Remove file manually to avoid the 'File Exists' error when creating 7Remove file manually to avoid the 'File Exists' error when creating
@@ -18,10 +18,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18 3 files changed, 8 insertions(+), 6 deletions(-) 18 3 files changed, 8 insertions(+), 6 deletions(-)
19 19
20diff --git a/meson.build b/meson.build 20diff --git a/meson.build b/meson.build
21index 04331dd41..6d5edcb4e 100644 21index 56c98b9..3386546 100644
22--- a/meson.build 22--- a/meson.build
23+++ b/meson.build 23+++ b/meson.build
24@@ -558,10 +558,6 @@ endforeach 24@@ -630,10 +630,6 @@ endforeach
25 25
26 conf.set_quoted('TELINIT', get_option('telinit-path')) 26 conf.set_quoted('TELINIT', get_option('telinit-path'))
27 27
@@ -33,7 +33,7 @@ index 04331dd41..6d5edcb4e 100644
33 33
34 gperf = find_program('gperf') 34 gperf = find_program('gperf')
35diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh 35diff --git a/tools/meson-make-symlink.sh b/tools/meson-make-symlink.sh
36index 501cd43d4..f4e4ac9ac 100755 36index 501cd43..f4e4ac9 100755
37--- a/tools/meson-make-symlink.sh 37--- a/tools/meson-make-symlink.sh
38+++ b/tools/meson-make-symlink.sh 38+++ b/tools/meson-make-symlink.sh
39@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")" 39@@ -8,5 +8,6 @@ mkdir -vp "$(dirname "${DESTDIR:-}$2")"
@@ -45,7 +45,7 @@ index 501cd43d4..f4e4ac9ac 100755
45+ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2" 45+ lnr "${DESTDIR:-}$1" "${DESTDIR:-}$2"
46 fi 46 fi
47diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh 47diff --git a/units/meson-add-wants.sh b/units/meson-add-wants.sh
48index 70f7172ae..a42666aac 100755 48index e2b2603..210d604 100755
49--- a/units/meson-add-wants.sh 49--- a/units/meson-add-wants.sh
50+++ b/units/meson-add-wants.sh 50+++ b/units/meson-add-wants.sh
51@@ -25,4 +25,9 @@ case "$target" in 51@@ -25,4 +25,9 @@ case "$target" in
@@ -60,5 +60,5 @@ index 70f7172ae..a42666aac 100755
60+ lnr "$unitpath" "$dir" 60+ lnr "$unitpath" "$dir"
61+fi 61+fi
62-- 62--
632.11.0 632.7.4
64 64
diff --git a/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch b/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
deleted file mode 100644
index 115fb33c30..0000000000
--- a/meta/recipes-core/systemd/systemd/0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch
+++ /dev/null
@@ -1,40 +0,0 @@
1From e965e748c7030df0709e63128db2f023540a06ba Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 12 Sep 2015 18:53:31 +0000
4Subject: [PATCH 03/19] comparison_fn_t is glibc specific, use raw signature in
5 function pointer
6
7make it work with musl where comparison_fn_t is not provided
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/basic/util.h | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/src/basic/util.h b/src/basic/util.h
17index 40eaf518c..c58392397 100644
18--- a/src/basic/util.h
19+++ b/src/basic/util.h
20@@ -77,7 +77,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
21 * that only if nmemb > 0.
22 */
23 static inline void* bsearch_safe(const void *key, const void *base,
24- size_t nmemb, size_t size, comparison_fn_t compar) {
25+ size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
26 if (nmemb <= 0)
27 return NULL;
28
29@@ -89,7 +89,7 @@ static inline void* bsearch_safe(const void *key, const void *base,
30 * Normal qsort requires base to be nonnull. Here were require
31 * that only if nmemb > 0.
32 */
33-static inline void qsort_safe(void *base, size_t nmemb, size_t size, comparison_fn_t compar) {
34+static inline void qsort_safe(void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) {
35 if (nmemb <= 1)
36 return;
37
38--
392.11.0
40
diff --git a/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch b/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
index 6c595ae733..6695d56804 100644
--- a/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
+++ b/meta/recipes-core/systemd/systemd/0003-implment-systemd-sysv-install-for-OE.patch
@@ -1,7 +1,7 @@
1From 0fcb6e646401205e17cc6c129441a49023c62cef Mon Sep 17 00:00:00 2001 1From 47864989388bcd04d647ecf618ad7e260399dbb6 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 5 Sep 2015 06:31:47 +0000 3Date: Sat, 5 Sep 2015 06:31:47 +0000
4Subject: [PATCH 3/9] implment systemd-sysv-install for OE 4Subject: [PATCH 3/5] implment systemd-sysv-install for OE
5 5
6Use update-rc.d for enabling/disabling and status command 6Use update-rc.d for enabling/disabling and status command
7to check the status of the sysv service 7to check the status of the sysv service
@@ -14,7 +14,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
14 1 file changed, 3 insertions(+), 3 deletions(-) 14 1 file changed, 3 insertions(+), 3 deletions(-)
15 15
16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON 16diff --git a/src/systemctl/systemd-sysv-install.SKELETON b/src/systemctl/systemd-sysv-install.SKELETON
17index 8c16cf999..9f078a121 100755 17index 8c16cf9..9f078a1 100755
18--- a/src/systemctl/systemd-sysv-install.SKELETON 18--- a/src/systemctl/systemd-sysv-install.SKELETON
19+++ b/src/systemctl/systemd-sysv-install.SKELETON 19+++ b/src/systemctl/systemd-sysv-install.SKELETON
20@@ -32,17 +32,17 @@ case "$1" in 20@@ -32,17 +32,17 @@ case "$1" in
@@ -39,5 +39,5 @@ index 8c16cf999..9f078a121 100755
39 *) 39 *)
40 usage ;; 40 usage ;;
41-- 41--
422.11.0 422.7.4
43 43
diff --git a/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch b/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch
new file mode 100644
index 0000000000..5246b4b26c
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch
@@ -0,0 +1,61 @@
1From a9421d55102fc84f77f7c21a2479fcd00652b896 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 13:55:12 +0800
4Subject: [PATCH 03/24] missing_type.h: add __compare_fn_t and comparison_fn_t
5
6Make it work with musl where comparison_fn_t and __compare_fn_t
7is not provided.
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/basic/missing_type.h | 9 +++++++++
14 src/basic/util.h | 1 +
15 src/journal/catalog.c | 1 +
16 3 files changed, 11 insertions(+)
17
18diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
19index bf8a6ca..c487e65 100644
20--- a/src/basic/missing_type.h
21+++ b/src/basic/missing_type.h
22@@ -10,3 +10,12 @@
23 #if !HAVE_CHAR16_T
24 #define char16_t uint16_t
25 #endif
26+
27+#ifndef __GLIBC__
28+typedef int (*comparison_fn_t)(const void *, const void *);
29+#endif
30+
31+#ifndef __COMPAR_FN_T
32+#define __COMPAR_FN_T
33+typedef int (*__compar_fn_t)(const void *, const void *);
34+#endif
35diff --git a/src/basic/util.h b/src/basic/util.h
36index 9f6a6ce..2c5dc32 100644
37--- a/src/basic/util.h
38+++ b/src/basic/util.h
39@@ -26,6 +26,7 @@
40 #include "format-util.h"
41 #include "macro.h"
42 #include "time-util.h"
43+#include "missing.h"
44
45 size_t page_size(void) _pure_;
46 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
47diff --git a/src/journal/catalog.c b/src/journal/catalog.c
48index 4062f12..034e00c 100644
49--- a/src/journal/catalog.c
50+++ b/src/journal/catalog.c
51@@ -26,6 +26,7 @@
52 #include "strv.h"
53 #include "tmpfile-util.h"
54 #include "util.h"
55+#include "missing.h"
56
57 const char * const catalog_file_dirs[] = {
58 "/usr/local/lib/systemd/catalog/",
59--
602.7.4
61
diff --git a/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
index 7652a2d8cc..bb738e22c1 100644
--- a/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
+++ b/meta/recipes-core/systemd/systemd/0004-add-fallback-parse_printf_format-implementation.patch
@@ -1,7 +1,7 @@
1From 582af7ec13131dfcc620ed81de7b211914c4cb03 Mon Sep 17 00:00:00 2001 1From 7bcf3b166694090497a0acd2c5299e4e04fcc9b6 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 29 Jun 2018 13:43:49 +0800 3Date: Mon, 25 Feb 2019 14:04:21 +0800
4Subject: [PATCH 04/19] add fallback parse_printf_format implementation 4Subject: [PATCH 04/24] add fallback parse_printf_format implementation
5 5
6Upstream-Status: Inappropriate [musl specific] 6Upstream-Status: Inappropriate [musl specific]
7 7
@@ -20,25 +20,25 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
20 create mode 100644 src/basic/parse-printf-format.h 20 create mode 100644 src/basic/parse-printf-format.h
21 21
22diff --git a/meson.build b/meson.build 22diff --git a/meson.build b/meson.build
23index e045b9224..8c16bc979 100644 23index 3386546..44b24ee 100644
24--- a/meson.build 24--- a/meson.build
25+++ b/meson.build 25+++ b/meson.build
26@@ -598,6 +598,7 @@ foreach header : ['crypt.h', 26@@ -667,6 +667,7 @@ foreach header : ['crypt.h',
27 'linux/btrfs.h',
28 'linux/memfd.h', 27 'linux/memfd.h',
29 'linux/vm_sockets.h', 28 'linux/vm_sockets.h',
29 'linux/can/vxcan.h',
30+ 'printf.h', 30+ 'printf.h',
31 'sys/auxv.h', 31 'sys/auxv.h',
32 'valgrind/memcheck.h', 32 'valgrind/memcheck.h',
33 'valgrind/valgrind.h', 33 'valgrind/valgrind.h',
34diff --git a/src/basic/meson.build b/src/basic/meson.build 34diff --git a/src/basic/meson.build b/src/basic/meson.build
35index 31625b178..0c27528e7 100644 35index e5852f3..2192a0c 100644
36--- a/src/basic/meson.build 36--- a/src/basic/meson.build
37+++ b/src/basic/meson.build 37+++ b/src/basic/meson.build
38@@ -302,6 +302,11 @@ foreach item : [['af', af_list_txt, 'af', ''], 38@@ -284,6 +284,11 @@ foreach item : [['af', af_list_txt, 'af', ''],
39 endforeach 39 endforeach
40 40
41 basic_sources += [missing_h] + generated_gperf_headers 41 basic_sources += generated_gperf_headers
42+ 42+
43+if conf.get('HAVE_PRINTF_H') != 1 43+if conf.get('HAVE_PRINTF_H') != 1
44+ basic_sources += [files('parse-printf-format.c')] 44+ basic_sources += [files('parse-printf-format.c')]
@@ -49,7 +49,7 @@ index 31625b178..0c27528e7 100644
49 'gcrypt-util.h') 49 'gcrypt-util.h')
50diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c 50diff --git a/src/basic/parse-printf-format.c b/src/basic/parse-printf-format.c
51new file mode 100644 51new file mode 100644
52index 000000000..49437e544 52index 0000000..49437e5
53--- /dev/null 53--- /dev/null
54+++ b/src/basic/parse-printf-format.c 54+++ b/src/basic/parse-printf-format.c
55@@ -0,0 +1,273 @@ 55@@ -0,0 +1,273 @@
@@ -328,7 +328,7 @@ index 000000000..49437e544
328+} 328+}
329diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h 329diff --git a/src/basic/parse-printf-format.h b/src/basic/parse-printf-format.h
330new file mode 100644 330new file mode 100644
331index 000000000..47be7522d 331index 0000000..47be752
332--- /dev/null 332--- /dev/null
333+++ b/src/basic/parse-printf-format.h 333+++ b/src/basic/parse-printf-format.h
334@@ -0,0 +1,57 @@ 334@@ -0,0 +1,57 @@
@@ -390,10 +390,10 @@ index 000000000..47be7522d
390+ 390+
391+#endif /* HAVE_PRINTF_H */ 391+#endif /* HAVE_PRINTF_H */
392diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h 392diff --git a/src/basic/stdio-util.h b/src/basic/stdio-util.h
393index 73c03274c..30192cd71 100644 393index dc67b6e..cf8d514 100644
394--- a/src/basic/stdio-util.h 394--- a/src/basic/stdio-util.h
395+++ b/src/basic/stdio-util.h 395+++ b/src/basic/stdio-util.h
396@@ -1,12 +1,12 @@ 396@@ -1,13 +1,13 @@
397 /* SPDX-License-Identifier: LGPL-2.1+ */ 397 /* SPDX-License-Identifier: LGPL-2.1+ */
398 #pragma once 398 #pragma once
399 399
@@ -403,12 +403,13 @@ index 73c03274c..30192cd71 100644
403 #include <sys/types.h> 403 #include <sys/types.h>
404 404
405 #include "macro.h" 405 #include "macro.h"
406 #include "util.h"
406+#include "parse-printf-format.h" 407+#include "parse-printf-format.h"
407 408
408 #define snprintf_ok(buf, len, fmt, ...) \ 409 #define snprintf_ok(buf, len, fmt, ...) \
409 ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len)) 410 ((size_t) snprintf(buf, len, fmt, __VA_ARGS__) < (len))
410diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c 411diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
411index a0621524a..65bcbcd2e 100644 412index 8618454..3fea912 100644
412--- a/src/journal/journal-send.c 413--- a/src/journal/journal-send.c
413+++ b/src/journal/journal-send.c 414+++ b/src/journal/journal-send.c
414@@ -2,7 +2,6 @@ 415@@ -2,7 +2,6 @@
@@ -420,13 +421,13 @@ index a0621524a..65bcbcd2e 100644
420 #include <sys/socket.h> 421 #include <sys/socket.h>
421 #include <sys/un.h> 422 #include <sys/un.h>
422@@ -21,6 +20,7 @@ 423@@ -21,6 +20,7 @@
423 #include "stdio-util.h"
424 #include "string-util.h" 424 #include "string-util.h"
425 #include "tmpfile-util.h"
425 #include "util.h" 426 #include "util.h"
426+#include "parse-printf-format.h" 427+#include "parse-printf-format.h"
427 428
428 #define SNDBUF_SIZE (8*1024*1024) 429 #define SNDBUF_SIZE (8*1024*1024)
429 430
430-- 431--
4312.11.0 4322.7.4
432 433
diff --git a/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch b/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
index 7e37cbc2c1..738f8eb7b6 100644
--- a/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0004-rules-whitelist-hd-devices.patch
@@ -1,7 +1,7 @@
1From 5d8128f3832fd11fd046d1d1ad86c4ee7bc1dff0 Mon Sep 17 00:00:00 2001 1From dc0a6a9fe4da9738efaba942233ad39da625a918 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 9 Nov 2016 19:41:13 -0800 3Date: Thu, 21 Feb 2019 16:28:21 +0800
4Subject: [PATCH 4/9] rules: whitelist hd* devices 4Subject: [PATCH 4/5] rules: whitelist hd* devices
5 5
6qemu by default emulates IDE and the linux-yocto kernel(s) use 6qemu by default emulates IDE and the linux-yocto kernel(s) use
7CONFIG_IDE instead of the more modern libsata, so disks appear as 7CONFIG_IDE instead of the more modern libsata, so disks appear as
@@ -11,23 +11,25 @@ Upstream-Status: Denied [https://github.com/systemd/systemd/pull/1276]
11 11
12Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> 12Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
13Signed-off-by: Khem Raj <raj.khem@gmail.com> 13Signed-off-by: Khem Raj <raj.khem@gmail.com>
14[rebased for systemd 241]
15Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14--- 16---
15 rules/60-persistent-storage.rules | 2 +- 17 rules/60-persistent-storage.rules | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-) 18 1 file changed, 1 insertion(+), 1 deletion(-)
17 19
18diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules 20diff --git a/rules/60-persistent-storage.rules b/rules/60-persistent-storage.rules
19index 8ddb7577c..811e948ad 100644 21index 1d8880e..e53c8ea 100644
20--- a/rules/60-persistent-storage.rules 22--- a/rules/60-persistent-storage.rules
21+++ b/rules/60-persistent-storage.rules 23+++ b/rules/60-persistent-storage.rules
22@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end" 24@@ -7,7 +7,7 @@ ACTION=="remove", GOTO="persistent_storage_end"
23 ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end" 25 ENV{UDEV_DISABLE_PERSISTENT_STORAGE_RULES_FLAG}=="1", GOTO="persistent_storage_end"
24 26
25 SUBSYSTEM!="block", GOTO="persistent_storage_end" 27 SUBSYSTEM!="block", GOTO="persistent_storage_end"
26-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*", GOTO="persistent_storage_end" 28-KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|zd*", GOTO="persistent_storage_end"
27+KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|hd*", GOTO="persistent_storage_end" 29+KERNEL!="loop*|mmcblk*[0-9]|msblk*[0-9]|mspblk*[0-9]|nvme*|sd*|sr*|vd*|xvd*|bcache*|cciss*|dasd*|ubd*|scm*|pmem*|nbd*|zd*|hd*", GOTO="persistent_storage_end"
28 30
29 # ignore partitions that span the entire disk 31 # ignore partitions that span the entire disk
30 TEST=="whole_disk", GOTO="persistent_storage_end" 32 TEST=="whole_disk", GOTO="persistent_storage_end"
31-- 33--
322.11.0 342.7.4
33 35
diff --git a/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch b/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
deleted file mode 100644
index c13708728e..0000000000
--- a/meta/recipes-core/systemd/systemd/0005-Make-root-s-home-directory-configurable.patch
+++ /dev/null
@@ -1,70 +0,0 @@
1From 8b82663aeeedf9ca58e3b97116b4c4da5229e0f5 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 27 Jun 2018 16:46:45 +0800
4Subject: [PATCH 5/9] Make root's home directory configurable
5
6OpenEmbedded has a configurable home directory for root. Allow
7systemd to be built using its idea of what root's home directory
8should be.
9
10Upstream-Status: Denied
11Upstream wants to have a unified hierarchy where everyone is
12using the same root folder.
13https://github.com/systemd/systemd/issues/541
14
15Signed-off-by: Dan McGregor <dan.mcgregor@usask.ca>
16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18---
19 meson.build | 7 +++++++
20 meson_options.txt | 2 ++
21 2 files changed, 9 insertions(+)
22
23diff --git a/meson.build b/meson.build
24index 6d5edcb4e..323146fe1 100644
25--- a/meson.build
26+++ b/meson.build
27@@ -89,6 +89,11 @@ if rootlibdir == ''
28 rootlibdir = join_paths(rootprefixdir, libdir.split('/')[-1])
29 endif
30
31+roothomedir = get_option('roothomedir')
32+if roothomedir == ''
33+ roothomedir = '/root'
34+endif
35+
36 # Dirs of external packages
37 pkgconfigdatadir = join_paths(datadir, 'pkgconfig')
38 pkgconfiglibdir = join_paths(libdir, 'pkgconfig')
39@@ -210,6 +215,7 @@ conf.set_quoted('UDEVLIBEXECDIR', udevlibexecdir)
40 conf.set_quoted('POLKIT_AGENT_BINARY_PATH', join_paths(bindir, 'pkttyagent'))
41 conf.set_quoted('LIBDIR', libdir)
42 conf.set_quoted('ROOTLIBDIR', rootlibdir)
43+conf.set_quoted('ROOTHOMEDIR', roothomedir)
44 conf.set_quoted('ROOTLIBEXECDIR', rootlibexecdir)
45 conf.set_quoted('BOOTLIBDIR', bootlibdir)
46 conf.set_quoted('SYSTEMD_PULL_PATH', join_paths(rootlibexecdir, 'systemd-pull'))
47@@ -228,6 +234,7 @@ substs.set('prefix', prefixdir)
48 substs.set('exec_prefix', prefixdir)
49 substs.set('libdir', libdir)
50 substs.set('rootlibdir', rootlibdir)
51+substs.set('roothomedir', roothomedir)
52 substs.set('includedir', includedir)
53 substs.set('pkgsysconfdir', pkgsysconfdir)
54 substs.set('bindir', bindir)
55diff --git a/meson_options.txt b/meson_options.txt
56index 16c1f2b2f..aa9a33368 100644
57--- a/meson_options.txt
58+++ b/meson_options.txt
59@@ -9,6 +9,8 @@ option('rootlibdir', type : 'string',
60 description : '''[/usr]/lib/x86_64-linux-gnu or such''')
61 option('rootprefix', type : 'string',
62 description : '''override the root prefix''')
63+option('roothomedir', type : 'string',
64+ description : '''override the root home directory''')
65 option('link-udev-shared', type : 'boolean',
66 description : 'link systemd-udev and its helpers to libsystemd-shared.so')
67 option('link-systemctl-shared', type: 'boolean',
68--
692.11.0
70
diff --git a/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch b/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch
deleted file mode 100644
index 518c05b73a..0000000000
--- a/meta/recipes-core/systemd/systemd/0005-basic-user-util-properly-protect-use-of-gshadow.patch
+++ /dev/null
@@ -1,38 +0,0 @@
1From 66a5b5ce9b991327d594f7b635de16999ca54093 Mon Sep 17 00:00:00 2001
2From: "Yann E. MORIN" <yann.morin.1998@free.fr>
3Date: Wed, 21 Nov 2018 18:09:04 +0100
4Subject: basic/user-util: properly protect use of gshadow
5
6Commit 100d5f6ee6 (user-util: add new wrappers for [...] database
7files), ammended by commit 4f07ffa8f5 (Use #if instead of #ifdef for
8ENABLE_GSHADOW) moved code from sysuser to basic/user-util.
9
10In doing so, the combination of both commits properly propagated the
11ENABLE_GSHADOW conditions around the function manipulating gshadow, but
12they forgot to protect the inclusion of the gshadow.h header.
13
14Fix that to be able to build on C libraries that do not provide gshadow
15(e.g. uClibc-ng, where it does not exist.)
16
17Upstream-Status: Backport [https://github.com/systemd/systemd/commit/66a5b5ce9b991327d594f7b635de16999ca54093]
18---
19 src/basic/user-util.h | 2 ++
20 1 file changed, 2 insertions(+)
21
22diff --git a/src/basic/user-util.h b/src/basic/user-util.h
23index b6de0e423..cc899ee76 100644
24--- a/src/basic/user-util.h
25+++ b/src/basic/user-util.h
26@@ -2,7 +2,9 @@
27 #pragma once
28
29 #include <grp.h>
30+#if ENABLE_GSHADOW
31 #include <gshadow.h>
32+#endif
33 #include <pwd.h>
34 #include <shadow.h>
35 #include <stdbool.h>
36--
372.18.1
38
diff --git a/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch b/meta/recipes-core/systemd/systemd/0005-rules-watch-metadata-changes-in-ide-devices.patch
index a5f65e66bd..2123052ff6 100644
--- a/meta/recipes-core/systemd/systemd/0007-rules-watch-metadata-changes-in-ide-devices.patch
+++ b/meta/recipes-core/systemd/systemd/0005-rules-watch-metadata-changes-in-ide-devices.patch
@@ -1,7 +1,7 @@
1From 9302b72e5e69512aaa7106197b00c55baeb35b3c Mon Sep 17 00:00:00 2001 1From d1bccc721dd8f43fee29c5df0e9b78345e69f4b6 Mon Sep 17 00:00:00 2001
2From: Hongxu Jia <hongxu.jia@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 17 Nov 2017 09:46:00 +0800 3Date: Thu, 21 Feb 2019 16:38:38 +0800
4Subject: [PATCH 7/9] rules: watch metadata changes in ide devices 4Subject: [PATCH 5/5] rules: watch metadata changes in ide devices
5 5
6Formatting IDE storage does not trigger "change" uevents. As a result 6Formatting IDE storage does not trigger "change" uevents. As a result
7clients using udev API don't get any updates afterwards and get outdated 7clients using udev API don't get any updates afterwards and get outdated
@@ -24,20 +24,22 @@ CONFIG_IDE instead of the more modern libsata, so disks appear as
24is deprecated. 24is deprecated.
25 25
26Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> 26Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
27[rebased for systemd 241]
28Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
27--- 29---
28 rules/60-block.rules | 2 +- 30 rules/60-block.rules | 2 +-
29 1 file changed, 1 insertion(+), 1 deletion(-) 31 1 file changed, 1 insertion(+), 1 deletion(-)
30 32
31diff --git a/rules/60-block.rules b/rules/60-block.rules 33diff --git a/rules/60-block.rules b/rules/60-block.rules
32index 343fc06f8..b5237dac4 100644 34index a1458e9..3ba4b6b4 100644
33--- a/rules/60-block.rules 35--- a/rules/60-block.rules
34+++ b/rules/60-block.rules 36+++ b/rules/60-block.rules
35@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_ 37@@ -8,4 +8,4 @@ ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_
36 ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change" 38 ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
37 39
38 # watch metadata changes, caused by tools closing the device node which was opened for writing 40 # watch metadata changes, caused by tools closing the device node which was opened for writing
39-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*", OPTIONS+="watch" 41-ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|dasd*", OPTIONS+="watch"
40+ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|hd*", OPTIONS+="watch" 42+ACTION!="remove", SUBSYSTEM=="block", KERNEL=="loop*|nvme*|sd*|vd*|xvd*|pmem*|mmcblk*|dasd*|hd*", OPTIONS+="watch"
41-- 43--
422.11.0 442.7.4
43 45
diff --git a/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch b/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch
index 107a794398..f20897b5f8 100644
--- a/meta/recipes-core/systemd/systemd/0006-src-basic-missing.h-check-for-missing-strndupa.patch
+++ b/meta/recipes-core/systemd/systemd/0005-src-basic-missing.h-check-for-missing-strndupa.patch
@@ -1,7 +1,7 @@
1From 03fd19fc87573276e0d359260c8fe591f5f0216a Mon Sep 17 00:00:00 2001 1From 399fd3eda3045636a70da438a0fd1406cc332ed1 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 29 Jun 2018 16:34:50 +0800 3Date: Mon, 25 Feb 2019 14:18:21 +0800
4Subject: [PATCH 06/19] src/basic/missing.h: check for missing strndupa 4Subject: [PATCH 05/24] src/basic/missing.h: check for missing strndupa
5 5
6include missing.h for definition of strndupa 6include missing.h for definition of strndupa
7 7
@@ -10,20 +10,20 @@ Upstream-Status: Inappropriate [musl specific]
10Signed-off-by: Khem Raj <raj.khem@gmail.com> 10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12--- 12---
13 meson.build | 1 + 13 meson.build | 1 +
14 src/basic/missing.h | 11 +++++++++++ 14 src/basic/missing_stdlib.h | 12 ++++++++++++
15 src/basic/mkdir.c | 1 + 15 src/basic/mkdir.c | 1 +
16 src/basic/pager.c | 1 + 16 src/basic/parse-util.c | 1 +
17 src/basic/parse-util.c | 1 + 17 src/basic/procfs-util.c | 1 +
18 src/basic/procfs-util.c | 1 + 18 src/shared/pager.c | 1 +
19 src/shared/uid-range.c | 1 + 19 src/shared/uid-range.c | 1 +
20 7 files changed, 17 insertions(+) 20 7 files changed, 18 insertions(+)
21 21
22diff --git a/meson.build b/meson.build 22diff --git a/meson.build b/meson.build
23index 8c16bc979..a734a295c 100644 23index 44b24ee..70fb218 100644
24--- a/meson.build 24--- a/meson.build
25+++ b/meson.build 25+++ b/meson.build
26@@ -503,6 +503,7 @@ foreach ident : [ 26@@ -558,6 +558,7 @@ foreach ident : [
27 #include <unistd.h>'''], 27 #include <unistd.h>'''],
28 ['explicit_bzero' , '''#include <string.h>'''], 28 ['explicit_bzero' , '''#include <string.h>'''],
29 ['reallocarray', '''#include <malloc.h>'''], 29 ['reallocarray', '''#include <malloc.h>'''],
@@ -31,14 +31,16 @@ index 8c16bc979..a734a295c 100644
31 ] 31 ]
32 32
33 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE') 33 have = cc.has_function(ident[0], prefix : ident[1], args : '-D_GNU_SOURCE')
34diff --git a/src/basic/missing.h b/src/basic/missing.h 34diff --git a/src/basic/missing_stdlib.h b/src/basic/missing_stdlib.h
35index 0e33abb9f..02397f1b6 100644 35index c0ffe86..d50274b 100644
36--- a/src/basic/missing.h 36--- a/src/basic/missing_stdlib.h
37+++ b/src/basic/missing.h 37+++ b/src/basic/missing_stdlib.h
38@@ -1184,6 +1184,17 @@ struct input_mask { 38@@ -11,3 +11,15 @@
39 typedef int32_t key_serial_t; 39 # define secure_getenv getenv
40 # endif
40 #endif 41 #endif
41 42+
43+/* string.h */
42+#if ! HAVE_STRNDUPA 44+#if ! HAVE_STRNDUPA
43+#define strndupa(s, n) \ 45+#define strndupa(s, n) \
44+ ({ \ 46+ ({ \
@@ -49,12 +51,8 @@ index 0e33abb9f..02397f1b6 100644
49+ (char *)memcpy(__new, __old, __len); \ 51+ (char *)memcpy(__new, __old, __len); \
50+ }) 52+ })
51+#endif 53+#endif
52+
53 #ifndef KEYCTL_JOIN_SESSION_KEYRING
54 #define KEYCTL_JOIN_SESSION_KEYRING 1
55 #endif
56diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c 54diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c
57index 6ab1b4422..77c3e0863 100644 55index 4bb65d5..3038ab9 100644
58--- a/src/basic/mkdir.c 56--- a/src/basic/mkdir.c
59+++ b/src/basic/mkdir.c 57+++ b/src/basic/mkdir.c
60@@ -13,6 +13,7 @@ 58@@ -13,6 +13,7 @@
@@ -65,32 +63,20 @@ index 6ab1b4422..77c3e0863 100644
65 63
66 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir) { 64 int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, MkdirFlags flags, mkdir_func_t _mkdir) {
67 struct stat st; 65 struct stat st;
68diff --git a/src/basic/pager.c b/src/basic/pager.c
69index f24126111..8223bff02 100644
70--- a/src/basic/pager.c
71+++ b/src/basic/pager.c
72@@ -21,6 +21,7 @@
73 #include "string-util.h"
74 #include "strv.h"
75 #include "terminal-util.h"
76+#include "missing.h"
77
78 static pid_t pager_pid = 0;
79
80diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c 66diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c
81index 6becf8587..52576f536 100644 67index 87724af..d9c53bc 100644
82--- a/src/basic/parse-util.c 68--- a/src/basic/parse-util.c
83+++ b/src/basic/parse-util.c 69+++ b/src/basic/parse-util.c
84@@ -17,6 +17,7 @@ 70@@ -19,6 +19,7 @@
85 #include "parse-util.h"
86 #include "process-util.h" 71 #include "process-util.h"
72 #include "stat-util.h"
87 #include "string-util.h" 73 #include "string-util.h"
88+#include "missing.h" 74+#include "missing.h"
89 75
90 int parse_boolean(const char *v) { 76 int parse_boolean(const char *v) {
91 assert(v); 77 if (!v)
92diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c 78diff --git a/src/basic/procfs-util.c b/src/basic/procfs-util.c
93index a159e344b..ebc427d6b 100644 79index 7aaf95b..42ce53d 100644
94--- a/src/basic/procfs-util.c 80--- a/src/basic/procfs-util.c
95+++ b/src/basic/procfs-util.c 81+++ b/src/basic/procfs-util.c
96@@ -11,6 +11,7 @@ 82@@ -11,6 +11,7 @@
@@ -101,18 +87,30 @@ index a159e344b..ebc427d6b 100644
101 87
102 int procfs_tasks_get_limit(uint64_t *ret) { 88 int procfs_tasks_get_limit(uint64_t *ret) {
103 _cleanup_free_ char *value = NULL; 89 _cleanup_free_ char *value = NULL;
90diff --git a/src/shared/pager.c b/src/shared/pager.c
91index bf2597e..fa9e321 100644
92--- a/src/shared/pager.c
93+++ b/src/shared/pager.c
94@@ -24,6 +24,7 @@
95 #include "string-util.h"
96 #include "strv.h"
97 #include "terminal-util.h"
98+#include "missing.h"
99
100 static pid_t pager_pid = 0;
101
104diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c 102diff --git a/src/shared/uid-range.c b/src/shared/uid-range.c
105index 434ce6ff4..37093ab7b 100644 103index 5fa7bd2..9c63b9e 100644
106--- a/src/shared/uid-range.c 104--- a/src/shared/uid-range.c
107+++ b/src/shared/uid-range.c 105+++ b/src/shared/uid-range.c
108@@ -8,6 +8,7 @@ 106@@ -9,6 +9,7 @@
109 #include "macro.h"
110 #include "uid-range.h" 107 #include "uid-range.h"
111 #include "user-util.h" 108 #include "user-util.h"
109 #include "util.h"
112+#include "missing.h" 110+#include "missing.h"
113 111
114 static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) { 112 static bool uid_range_intersect(UidRange *range, uid_t start, uid_t nr) {
115 assert(range); 113 assert(range);
116-- 114--
1172.11.0 1152.7.4
118 116
diff --git a/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch b/meta/recipes-core/systemd/systemd/0006-Include-netinet-if_ether.h.patch
index 2df8cf95fd..b41f6c7bee 100644
--- a/meta/recipes-core/systemd/systemd/0007-Include-netinet-if_ether.h.patch
+++ b/meta/recipes-core/systemd/systemd/0006-Include-netinet-if_ether.h.patch
@@ -1,7 +1,7 @@
1From aab90d0dfa934d33879eaec1a878e93b201d33f1 Mon Sep 17 00:00:00 2001 1From 67a988ae82c776d11be76de7180d50ea027ac442 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 29 Jun 2018 16:44:43 +0800 3Date: Mon, 25 Feb 2019 14:24:20 +0800
4Subject: [PATCH 07/19] Include netinet/if_ether.h 4Subject: [PATCH 06/24] Include netinet/if_ether.h
5 5
6Fixes 6Fixes
7/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr' 7/path/to/systemd/recipe-sysroot/usr/include/netinet/if_ether.h:101:8: error: redefinition of 'struct ethhdr'
@@ -22,7 +22,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22 6 files changed, 6 insertions(+) 22 6 files changed, 6 insertions(+)
23 23
24diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c 24diff --git a/src/libsystemd/sd-netlink/netlink-types.c b/src/libsystemd/sd-netlink/netlink-types.c
25index c93fe9cb4..2013d06e1 100644 25index 9dcd3f2..e23ff4c 100644
26--- a/src/libsystemd/sd-netlink/netlink-types.c 26--- a/src/libsystemd/sd-netlink/netlink-types.c
27+++ b/src/libsystemd/sd-netlink/netlink-types.c 27+++ b/src/libsystemd/sd-netlink/netlink-types.c
28@@ -3,6 +3,7 @@ 28@@ -3,6 +3,7 @@
@@ -34,7 +34,7 @@ index c93fe9cb4..2013d06e1 100644
34 #include <linux/rtnetlink.h> 34 #include <linux/rtnetlink.h>
35 #include <linux/genetlink.h> 35 #include <linux/genetlink.h>
36diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c 36diff --git a/src/network/netdev/tuntap.c b/src/network/netdev/tuntap.c
37index 21fb7ab06..0afe5170c 100644 37index 951138d..1ad499d 100644
38--- a/src/network/netdev/tuntap.c 38--- a/src/network/netdev/tuntap.c
39+++ b/src/network/netdev/tuntap.c 39+++ b/src/network/netdev/tuntap.c
40@@ -2,6 +2,7 @@ 40@@ -2,6 +2,7 @@
@@ -46,7 +46,7 @@ index 21fb7ab06..0afe5170c 100644
46 #include <net/if.h> 46 #include <net/if.h>
47 #include <netinet/if_ether.h> 47 #include <netinet/if_ether.h>
48diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c 48diff --git a/src/network/networkd-brvlan.c b/src/network/networkd-brvlan.c
49index 8e8a618e2..52d523a67 100644 49index 8377623..132af60 100644
50--- a/src/network/networkd-brvlan.c 50--- a/src/network/networkd-brvlan.c
51+++ b/src/network/networkd-brvlan.c 51+++ b/src/network/networkd-brvlan.c
52@@ -4,6 +4,7 @@ 52@@ -4,6 +4,7 @@
@@ -58,7 +58,7 @@ index 8e8a618e2..52d523a67 100644
58 #include <stdbool.h> 58 #include <stdbool.h>
59 59
60diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c 60diff --git a/src/udev/net/ethtool-util.c b/src/udev/net/ethtool-util.c
61index 4bb4216ac..5f7383483 100644 61index 0dcec03..3695b10 100644
62--- a/src/udev/net/ethtool-util.c 62--- a/src/udev/net/ethtool-util.c
63+++ b/src/udev/net/ethtool-util.c 63+++ b/src/udev/net/ethtool-util.c
64@@ -1,5 +1,6 @@ 64@@ -1,5 +1,6 @@
@@ -69,28 +69,28 @@ index 4bb4216ac..5f7383483 100644
69 #include <sys/ioctl.h> 69 #include <sys/ioctl.h>
70 #include <linux/ethtool.h> 70 #include <linux/ethtool.h>
71diff --git a/src/udev/net/ethtool-util.h b/src/udev/net/ethtool-util.h 71diff --git a/src/udev/net/ethtool-util.h b/src/udev/net/ethtool-util.h
72index 064bf4d2b..ee0d4fb2a 100644 72index 618b26b..ebfe82a 100644
73--- a/src/udev/net/ethtool-util.h 73--- a/src/udev/net/ethtool-util.h
74+++ b/src/udev/net/ethtool-util.h 74+++ b/src/udev/net/ethtool-util.h
75@@ -3,6 +3,7 @@ 75@@ -2,6 +2,7 @@
76 76 #pragma once
77 77
78 #include <macro.h> 78 #include <macro.h>
79+#include <netinet/if_ether.h> 79+#include <netinet/if_ether.h>
80 #include <linux/ethtool.h> 80 #include <linux/ethtool.h>
81 81
82 #include "missing.h" 82 #include "conf-parser.h"
83diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c 83diff --git a/src/udev/udev-builtin-net_setup_link.c b/src/udev/udev-builtin-net_setup_link.c
84index 8bed6399a..a3a96959b 100644 84index a845dfa..177289a 100644
85--- a/src/udev/udev-builtin-net_setup_link.c 85--- a/src/udev/udev-builtin-net_setup_link.c
86+++ b/src/udev/udev-builtin-net_setup_link.c 86+++ b/src/udev/udev-builtin-net_setup_link.c
87@@ -1,5 +1,6 @@ 87@@ -1,5 +1,6 @@
88 /* SPDX-License-Identifier: LGPL-2.1+ */ 88 /* SPDX-License-Identifier: LGPL-2.1+ */
89 89
90+#include <netinet/if_ether.h> 90+#include <netinet/if_ether.h>
91 #include "device-util.h"
91 #include "alloc-util.h" 92 #include "alloc-util.h"
92 #include "link-config.h" 93 #include "link-config.h"
93 #include "log.h"
94-- 94--
952.11.0 952.7.4
96 96
diff --git a/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch b/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
deleted file mode 100644
index eb6eb8bfeb..0000000000
--- a/meta/recipes-core/systemd/systemd/0006-remove-nobody-user-group-checking.patch
+++ /dev/null
@@ -1,63 +0,0 @@
1From 5199ae5dec9b8a9c9e20477d5090f1732735fbe2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 28 Jun 2018 09:38:12 +0800
4Subject: [PATCH 6/9] remove nobody user/group checking
5
6Upstream-Status: Inappropriate [OE Specific]
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 meson.build | 37 -------------------------------------
11 1 file changed, 37 deletions(-)
12
13diff --git a/meson.build b/meson.build
14index 323146fe1..3bb087fef 100644
15--- a/meson.build
16+++ b/meson.build
17@@ -681,43 +681,6 @@ substs.set('containeruidbasemax', container_uid_base_max)
18 nobody_user = get_option('nobody-user')
19 nobody_group = get_option('nobody-group')
20
21-getent_result = run_command('getent', 'passwd', '65534')
22-if getent_result.returncode() == 0
23- name = getent_result.stdout().split(':')[0]
24- if name != nobody_user
25- warning('\n' +
26- 'The local user with the UID 65534 does not match the configured user name "@0@" of the nobody user (its name is @1@).\n'.format(nobody_user, name) +
27- 'Your build will result in an user table setup that is incompatible with the local system.')
28- endif
29-endif
30-id_result = run_command('id', '-u', nobody_user)
31-if id_result.returncode() == 0
32- id = id_result.stdout().to_int()
33- if id != 65534
34- warning('\n' +
35- 'The local user with the configured user name "@0@" of the nobody user does not have UID 65534 (it has @1@).\n'.format(nobody_user, id) +
36- 'Your build will result in an user table setup that is incompatible with the local system.')
37- endif
38-endif
39-
40-getent_result = run_command('getent', 'group', '65534')
41-if getent_result.returncode() == 0
42- name = getent_result.stdout().split(':')[0]
43- if name != nobody_group
44- warning('\n' +
45- 'The local group with the GID 65534 does not match the configured group name "@0@" of the nobody group (its name is @1@).\n'.format(nobody_group, name) +
46- 'Your build will result in an group table setup that is incompatible with the local system.')
47- endif
48-endif
49-id_result = run_command('id', '-g', nobody_group)
50-if id_result.returncode() == 0
51- id = id_result.stdout().to_int()
52- if id != 65534
53- warning('\n' +
54- 'The local group with the configured group name "@0@" of the nobody group does not have UID 65534 (it has @1@).\n'.format(nobody_group, id) +
55- 'Your build will result in an group table setup that is incompatible with the local system.')
56- endif
57-endif
58 if nobody_user != nobody_group and not (nobody_user == 'nobody' and nobody_group == 'nogroup')
59 warning('\n' +
60 'The configured user name "@0@" and group name "@0@" of the nobody user/group are not equivalent.\n'.format(nobody_user, nobody_group) +
61--
622.11.0
63
diff --git a/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch b/meta/recipes-core/systemd/systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch
index bee5fb6511..765e4767fd 100644
--- a/meta/recipes-core/systemd/systemd/0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch
+++ b/meta/recipes-core/systemd/systemd/0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch
@@ -1,7 +1,7 @@
1From 848e711d719a6d987bc7d14183e1c7b1f1c91c56 Mon Sep 17 00:00:00 2001 1From f8a239b182158ca0a537ba053cb0e6bad9c3a2fb Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Fri, 29 Jun 2018 17:10:29 +0800 3Date: Mon, 25 Feb 2019 14:56:21 +0800
4Subject: [PATCH 08/19] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not 4Subject: [PATCH 07/24] don't fail if GLOB_BRACE and GLOB_ALTDIRFUNC is not
5 defined 5 defined
6 6
7If the standard library doesn't provide brace 7If the standard library doesn't provide brace
@@ -16,13 +16,13 @@ Upstream-Status: Inappropriate [musl specific]
16Signed-off-by: Khem Raj <raj.khem@gmail.com> 16Signed-off-by: Khem Raj <raj.khem@gmail.com>
17Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 17Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
18--- 18---
19 src/basic/glob-util.c | 13 +++++++++++-- 19 src/basic/glob-util.c | 12 +++++++++++-
20 src/test/test-glob-util.c | 15 +++++++++++++++ 20 src/test/test-glob-util.c | 17 +++++++++++++++--
21 src/tmpfiles/tmpfiles.c | 10 ++++++++++ 21 src/tmpfiles/tmpfiles.c | 9 +++++++++
22 3 files changed, 36 insertions(+), 2 deletions(-) 22 3 files changed, 35 insertions(+), 3 deletions(-)
23 23
24diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c 24diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c
25index 9fac676f2..8adb9559e 100644 25index 9fac676..962d8b9 100644
26--- a/src/basic/glob-util.c 26--- a/src/basic/glob-util.c
27+++ b/src/basic/glob-util.c 27+++ b/src/basic/glob-util.c
28@@ -10,6 +10,11 @@ 28@@ -10,6 +10,11 @@
@@ -45,12 +45,12 @@ index 9fac676f2..8adb9559e 100644
45 /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */ 45 /* We want to set GLOB_ALTDIRFUNC ourselves, don't allow it to be set. */
46 assert(!(flags & GLOB_ALTDIRFUNC)); 46 assert(!(flags & GLOB_ALTDIRFUNC));
47 47
48@@ -31,10 +37,13 @@ int safe_glob(const char *path, int flags, glob_t *pglob) { 48@@ -31,10 +37,14 @@ int safe_glob(const char *path, int flags, glob_t *pglob) {
49 pglob->gl_lstat = lstat; 49 pglob->gl_lstat = lstat;
50 if (!pglob->gl_stat) 50 if (!pglob->gl_stat)
51 pglob->gl_stat = stat; 51 pglob->gl_stat = stat;
52-
53+#endif 52+#endif
53
54 errno = 0; 54 errno = 0;
55+#ifdef GLOB_ALTDIRFUNC 55+#ifdef GLOB_ALTDIRFUNC
56 k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob); 56 k = glob(path, flags | GLOB_ALTDIRFUNC, NULL, pglob);
@@ -62,13 +62,13 @@ index 9fac676f2..8adb9559e 100644
62 return -ENOENT; 62 return -ENOENT;
63 if (k == GLOB_NOSPACE) 63 if (k == GLOB_NOSPACE)
64diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c 64diff --git a/src/test/test-glob-util.c b/src/test/test-glob-util.c
65index d78d6223c..f5943b26d 100644 65index b4f4144..955b3ba 100644
66--- a/src/test/test-glob-util.c 66--- a/src/test/test-glob-util.c
67+++ b/src/test/test-glob-util.c 67+++ b/src/test/test-glob-util.c
68@@ -12,6 +12,11 @@ 68@@ -12,6 +12,11 @@
69 #include "glob-util.h"
70 #include "macro.h" 69 #include "macro.h"
71 #include "rm-rf.h" 70 #include "rm-rf.h"
71 #include "tmpfile-util.h"
72+/* Don't fail if the standard library 72+/* Don't fail if the standard library
73+ * doesn't provide brace expansion */ 73+ * doesn't provide brace expansion */
74+#ifndef GLOB_BRACE 74+#ifndef GLOB_BRACE
@@ -77,9 +77,11 @@ index d78d6223c..f5943b26d 100644
77 77
78 static void test_glob_exists(void) { 78 static void test_glob_exists(void) {
79 char name[] = "/tmp/test-glob_exists.XXXXXX"; 79 char name[] = "/tmp/test-glob_exists.XXXXXX";
80@@ -40,11 +45,13 @@ static void test_glob_no_dot(void) { 80@@ -38,25 +43,33 @@ static void closedir_wrapper(void* v) {
81 static void test_glob_no_dot(void) {
82 char template[] = "/tmp/test-glob-util.XXXXXXX";
81 const char *fn; 83 const char *fn;
82 84-
83 _cleanup_globfree_ glob_t g = { 85 _cleanup_globfree_ glob_t g = {
84+#ifdef GLOB_ALTDIRFUNC 86+#ifdef GLOB_ALTDIRFUNC
85 .gl_closedir = closedir_wrapper, 87 .gl_closedir = closedir_wrapper,
@@ -89,9 +91,9 @@ index d78d6223c..f5943b26d 100644
89 .gl_stat = stat, 91 .gl_stat = stat,
90+#endif 92+#endif
91 }; 93 };
92 94-
93 int r; 95 int r;
94@@ -52,11 +59,19 @@ static void test_glob_no_dot(void) { 96
95 assert_se(mkdtemp(template)); 97 assert_se(mkdtemp(template));
96 98
97 fn = strjoina(template, "/*"); 99 fn = strjoina(template, "/*");
@@ -112,23 +114,22 @@ index d78d6223c..f5943b26d 100644
112 114
113 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL); 115 (void) rm_rf(template, REMOVE_ROOT|REMOVE_PHYSICAL);
114diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c 116diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
115index 927de35f3..5f0283da5 100644 117index b66765b..11dbbf4 100644
116--- a/src/tmpfiles/tmpfiles.c 118--- a/src/tmpfiles/tmpfiles.c
117+++ b/src/tmpfiles/tmpfiles.c 119+++ b/src/tmpfiles/tmpfiles.c
118@@ -60,6 +60,12 @@ 120@@ -60,6 +60,11 @@
121 #include "umask-util.h"
119 #include "user-util.h" 122 #include "user-util.h"
120 #include "util.h" 123 #include "util.h"
121
122+/* Don't fail if the standard library 124+/* Don't fail if the standard library
123+ * doesn't provide brace expansion */ 125+ * doesn't provide brace expansion */
124+#ifndef GLOB_BRACE 126+#ifndef GLOB_BRACE
125+#define GLOB_BRACE 0 127+#define GLOB_BRACE 0
126+#endif 128+#endif
127+ 129
128 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates 130 /* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
129 * them in the file system. This is intended to be used to create 131 * them in the file system. This is intended to be used to create
130 * properly owned directories beneath /tmp, /var/tmp, /run, which are 132@@ -1853,7 +1858,9 @@ finish:
131@@ -1345,7 +1351,9 @@ finish:
132 133
133 static int glob_item(Item *i, action_t action) { 134 static int glob_item(Item *i, action_t action) {
134 _cleanup_globfree_ glob_t g = { 135 _cleanup_globfree_ glob_t g = {
@@ -138,7 +139,7 @@ index 927de35f3..5f0283da5 100644
138 }; 139 };
139 int r = 0, k; 140 int r = 0, k;
140 char **fn; 141 char **fn;
141@@ -1365,7 +1373,9 @@ static int glob_item(Item *i, action_t action) { 142@@ -1873,7 +1880,9 @@ static int glob_item(Item *i, action_t action) {
142 143
143 static int glob_item_recursively(Item *i, fdaction_t action) { 144 static int glob_item_recursively(Item *i, fdaction_t action) {
144 _cleanup_globfree_ glob_t g = { 145 _cleanup_globfree_ glob_t g = {
@@ -149,5 +150,5 @@ index 927de35f3..5f0283da5 100644
149 int r = 0, k; 150 int r = 0, k;
150 char **fn; 151 char **fn;
151-- 152--
1522.11.0 1532.7.4
153 154
diff --git a/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch b/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
deleted file mode 100644
index abecdc764b..0000000000
--- a/meta/recipes-core/systemd/systemd/0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch
+++ /dev/null
@@ -1,29 +0,0 @@
1From b6ba596fd1313a162cdc2eb88161dcf24d19ede7 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Thu, 28 Jun 2018 10:10:02 +0800
4Subject: [PATCH 8/9] Do not enable nss tests if nss-systemd is not enabled
5
6Upstream-Status: Pending
7
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
10---
11 src/test/meson.build | 2 +-
12 1 file changed, 1 insertion(+), 1 deletion(-)
13
14diff --git a/src/test/meson.build b/src/test/meson.build
15index 7da7e3a22..7b7c257ff 100644
16--- a/src/test/meson.build
17+++ b/src/test/meson.build
18@@ -645,7 +645,7 @@ tests += [
19 [['src/test/test-nss.c'],
20 [],
21 [libdl],
22- '', 'manual'],
23+ 'ENABLE_NSS_SYSTEMD', 'manual'],
24
25 [['src/test/test-umount.c',
26 'src/core/mount-setup.c',
27--
282.11.0
29
diff --git a/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch b/meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch
index 95287cce10..d5f2349f2b 100644
--- a/meta/recipes-core/systemd/systemd/0009-add-missing-FTW_-macros-for-musl.patch
+++ b/meta/recipes-core/systemd/systemd/0008-add-missing-FTW_-macros-for-musl.patch
@@ -1,7 +1,7 @@
1From acc2c08082795802011e3c5f8626d63210021489 Mon Sep 17 00:00:00 2001 1From 6cd17c753d2c0a90fc791f69bbc694cbc8556a4f Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:36:32 -0800 3Date: Mon, 25 Feb 2019 15:00:06 +0800
4Subject: [PATCH 09/19] add missing FTW_ macros for musl 4Subject: [PATCH 08/24] add missing FTW_ macros for musl
5 5
6This is to avoid build failures like below for musl. 6This is to avoid build failures like below for musl.
7 7
@@ -11,17 +11,18 @@ Upstream-Status: Inappropriate [musl specific]
11 11
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13--- 13---
14 src/basic/missing.h | 20 ++++++++++++++++++++ 14 src/basic/missing_type.h | 20 ++++++++++++++++++++
15 1 file changed, 20 insertions(+) 15 1 file changed, 20 insertions(+)
16 16
17diff --git a/src/basic/missing.h b/src/basic/missing.h 17diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
18index 02397f1b6..6dc750eba 100644 18index c487e65..23602eb 100644
19--- a/src/basic/missing.h 19--- a/src/basic/missing_type.h
20+++ b/src/basic/missing.h 20+++ b/src/basic/missing_type.h
21@@ -189,6 +189,26 @@ struct sockaddr_vm { 21@@ -19,3 +19,23 @@ typedef int (*comparison_fn_t)(const void *, const void *);
22 #define BTRFS_QGROUP_LEVEL_SHIFT 48 22 #define __COMPAR_FN_T
23 typedef int (*__compar_fn_t)(const void *, const void *);
23 #endif 24 #endif
24 25+
25+#ifndef FTW_ACTIONRETVAL 26+#ifndef FTW_ACTIONRETVAL
26+#define FTW_ACTIONRETVAL 16 27+#define FTW_ACTIONRETVAL 16
27+#endif 28+#endif
@@ -41,10 +42,6 @@ index 02397f1b6..6dc750eba 100644
41+#ifndef FTW_SKIP_SIBLINGS 42+#ifndef FTW_SKIP_SIBLINGS
42+#define FTW_SKIP_SIBLINGS 3 43+#define FTW_SKIP_SIBLINGS 3
43+#endif 44+#endif
44+
45 #if ! HAVE_LINUX_BTRFS_H
46 #define BTRFS_IOC_QGROUP_ASSIGN _IOW(BTRFS_IOCTL_MAGIC, 41, \
47 struct btrfs_ioctl_qgroup_assign_args)
48-- 45--
492.11.0 462.7.4
50 47
diff --git a/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch b/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
deleted file mode 100644
index a635fa91d8..0000000000
--- a/meta/recipes-core/systemd/systemd/0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.patch
+++ /dev/null
@@ -1,43 +0,0 @@
1From f9625b5f3fd5dac3f3591dbeeb24dc9d6fda790d Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Feb 2018 12:56:21 +0800
4Subject: [PATCH 9/9] nss-mymachines: Build conditionally when
5 ENABLE_MYHOSTNAME is set
6
7Fixes build failures when building with --disable-myhostname
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 meson.build | 11 +++++++----
15 1 file changed, 7 insertions(+), 4 deletions(-)
16
17diff --git a/meson.build b/meson.build
18index 3bb087fef..73bd70b0b 100644
19--- a/meson.build
20+++ b/meson.build
21@@ -1371,12 +1371,15 @@ test_dlopen = executable(
22 link_with : [libbasic],
23 dependencies : [libdl])
24
25-foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME'],
26- ['systemd', 'ENABLE_NSS_SYSTEMD'],
27- ['mymachines', 'ENABLE_MACHINED'],
28- ['resolve', 'ENABLE_RESOLVE']]
29+foreach tuple : [['myhostname', 'ENABLE_MYHOSTNAME', ''],
30+ ['systemd', 'ENABLE_NSS_SYSTEMD', ''],
31+ ['mymachines', 'ENABLE_MACHINED', 'ENABLE_MYHOSTNAME'],
32+ ['resolve', 'ENABLE_RESOLVE', '']]
33
34 condition = tuple[1] == '' or conf.get(tuple[1]) == 1
35+ if tuple[2] != '' and condition
36+ condition = conf.get(tuple[2]) == 1
37+ endif
38 if condition
39 module = tuple[0]
40
41--
422.11.0
43
diff --git a/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch b/meta/recipes-core/systemd/systemd/0009-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
index 16547981d2..57cb5f3734 100644
--- a/meta/recipes-core/systemd/systemd/0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
+++ b/meta/recipes-core/systemd/systemd/0009-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch
@@ -1,7 +1,7 @@
1From a0bd587300744dbb8e9cfbb043233670ce781c98 Mon Sep 17 00:00:00 2001 1From 6a2cadd6b70cb40ac74fc0d0f8557b914bd38ac2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 2 Jul 2018 13:22:41 +0800 3Date: Mon, 2 Jul 2018 13:22:41 +0800
4Subject: [PATCH 10/19] socket-util: don't fail if libc doesn't support IDN 4Subject: [PATCH 09/24] socket-util: don't fail if libc doesn't support IDN
5 5
6Upstream-Status: Inappropriate [musl specific] 6Upstream-Status: Inappropriate [musl specific]
7 7
@@ -13,10 +13,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13 1 file changed, 10 insertions(+) 13 1 file changed, 10 insertions(+)
14 14
15diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c 15diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c
16index a913102e1..0d0154805 100644 16index 91bf801..c445fea 100644
17--- a/src/basic/socket-util.c 17--- a/src/basic/socket-util.c
18+++ b/src/basic/socket-util.c 18+++ b/src/basic/socket-util.c
19@@ -32,6 +32,16 @@ 19@@ -33,6 +33,16 @@
20 #include "utf8.h" 20 #include "utf8.h"
21 #include "util.h" 21 #include "util.h"
22 22
@@ -34,5 +34,5 @@ index a913102e1..0d0154805 100644
34 # define IDN_FLAGS NI_IDN 34 # define IDN_FLAGS NI_IDN
35 #else 35 #else
36-- 36--
372.11.0 372.7.4
38 38
diff --git a/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch b/meta/recipes-core/systemd/systemd/0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch
index d41bc4a0da..8bacd0289d 100644
--- a/meta/recipes-core/systemd/systemd/0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch
+++ b/meta/recipes-core/systemd/systemd/0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch
@@ -1,7 +1,7 @@
1From 1fadf805cb391e3bcbd9a0286a9e4b7adb9e7427 Mon Sep 17 00:00:00 2001 1From f1f4b4f9684fed185bfa8b9ed409cdf241657e99 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 2 Jul 2018 13:34:09 +0800 3Date: Mon, 25 Feb 2019 15:03:47 +0800
4Subject: [PATCH 12/19] fix missing of __register_atfork for non-glibc builds 4Subject: [PATCH 10/24] fix missing of __register_atfork for non-glibc builds
5 5
6Upstream-Status: Inappropriate [musl specific] 6Upstream-Status: Inappropriate [musl specific]
7 7
@@ -11,7 +11,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
11 1 file changed, 7 insertions(+) 11 1 file changed, 7 insertions(+)
12 12
13diff --git a/src/basic/process-util.c b/src/basic/process-util.c 13diff --git a/src/basic/process-util.c b/src/basic/process-util.c
14index 0a4f917cb..3543bc045 100644 14index 78ce43b..aec2daf 100644
15--- a/src/basic/process-util.c 15--- a/src/basic/process-util.c
16+++ b/src/basic/process-util.c 16+++ b/src/basic/process-util.c
17@@ -22,6 +22,9 @@ 17@@ -22,6 +22,9 @@
@@ -24,7 +24,7 @@ index 0a4f917cb..3543bc045 100644
24 24
25 #include "alloc-util.h" 25 #include "alloc-util.h"
26 #include "architecture.h" 26 #include "architecture.h"
27@@ -1150,11 +1153,15 @@ void reset_cached_pid(void) { 27@@ -1160,11 +1163,15 @@ void reset_cached_pid(void) {
28 cached_pid = CACHED_PID_UNSET; 28 cached_pid = CACHED_PID_UNSET;
29 } 29 }
30 30
@@ -32,8 +32,8 @@ index 0a4f917cb..3543bc045 100644
32 /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc 32 /* We use glibc __register_atfork() + __dso_handle directly here, as they are not included in the glibc
33 * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against 33 * headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
34 * libpthread, as it is part of glibc anyway. */ 34 * libpthread, as it is part of glibc anyway. */
35 extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void * __dso_handle); 35 extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
36 extern void* __dso_handle __attribute__ ((__weak__)); 36 extern void* __dso_handle _weak_;
37+#else 37+#else
38+#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child) 38+#define __register_atfork(prepare,parent,child,dso) pthread_atfork(prepare,parent,child)
39+#endif 39+#endif
@@ -41,5 +41,5 @@ index 0a4f917cb..3543bc045 100644
41 pid_t getpid_cached(void) { 41 pid_t getpid_cached(void) {
42 static bool installed = false; 42 static bool installed = false;
43-- 43--
442.11.0 442.7.4
45 45
diff --git a/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch b/meta/recipes-core/systemd/systemd/0011-Use-uintmax_t-for-handling-rlim_t.patch
index 69b3c15121..d6eda9c038 100644
--- a/meta/recipes-core/systemd/systemd/0013-Use-uintmax_t-for-handling-rlim_t.patch
+++ b/meta/recipes-core/systemd/systemd/0011-Use-uintmax_t-for-handling-rlim_t.patch
@@ -1,7 +1,7 @@
1From a0ac0cfd90af6431c64d1b276f422a2092d569b3 Mon Sep 17 00:00:00 2001 1From e3f847bd0338d27aff3335b42661d8a4b66b965e Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 2 Jul 2018 13:44:21 +0800 3Date: Mon, 25 Feb 2019 15:12:41 +0800
4Subject: [PATCH 13/19] Use uintmax_t for handling rlim_t 4Subject: [PATCH 11/24] Use uintmax_t for handling rlim_t
5 5
6PRIu{32,64} is not right format to represent rlim_t type 6PRIu{32,64} is not right format to represent rlim_t type
7therefore use %ju and typecast the rlim_t variables to 7therefore use %ju and typecast the rlim_t variables to
@@ -18,18 +18,19 @@ execute.c:3446:36: error: format '%lu' expects argument of type 'long unsigned i
18Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199] 18Upstream-Status: Denied [https://github.com/systemd/systemd/pull/7199]
19 19
20Signed-off-by: Khem Raj <raj.khem@gmail.com> 20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21[Rebased for v241]
21Signed-off-by: Chen Qi <Qi.Chen@windriver.com> 22Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22--- 23---
23 src/basic/format-util.h | 8 -------- 24 src/basic/format-util.h | 8 +-------
24 src/basic/rlimit-util.c | 8 ++++---- 25 src/basic/rlimit-util.c | 10 +++++-----
25 src/core/execute.c | 8 ++++---- 26 src/core/execute.c | 4 ++--
26 3 files changed, 8 insertions(+), 16 deletions(-) 27 3 files changed, 8 insertions(+), 14 deletions(-)
27 28
28diff --git a/src/basic/format-util.h b/src/basic/format-util.h 29diff --git a/src/basic/format-util.h b/src/basic/format-util.h
29index 160550cd6..61245d1e3 100644 30index dece5d3..dbb87bc 100644
30--- a/src/basic/format-util.h 31--- a/src/basic/format-util.h
31+++ b/src/basic/format-util.h 32+++ b/src/basic/format-util.h
32@@ -43,14 +43,6 @@ 33@@ -42,13 +42,7 @@
33 # define PRI_TIMEX "li" 34 # define PRI_TIMEX "li"
34 #endif 35 #endif
35 36
@@ -40,51 +41,57 @@ index 160550cd6..61245d1e3 100644
40-#else 41-#else
41-# error Unknown rlim_t size 42-# error Unknown rlim_t size
42-#endif 43-#endif
43- 44+#define RLIM_FMT "%ju"
45
44 #if SIZEOF_DEV_T == 8 46 #if SIZEOF_DEV_T == 8
45 # define DEV_FMT "%" PRIu64 47 # define DEV_FMT "%" PRIu64
46 #elif SIZEOF_DEV_T == 4
47diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c 48diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c
48index be1ba615e..e328ce499 100644 49index 74b3a02..b02c03c 100644
49--- a/src/basic/rlimit-util.c 50--- a/src/basic/rlimit-util.c
50+++ b/src/basic/rlimit-util.c 51+++ b/src/basic/rlimit-util.c
51@@ -299,13 +299,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) { 52@@ -307,13 +307,13 @@ int rlimit_format(const struct rlimit *rl, char **ret) {
52 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY) 53 if (rl->rlim_cur >= RLIM_INFINITY && rl->rlim_max >= RLIM_INFINITY)
53 s = strdup("infinity"); 54 s = strdup("infinity");
54 else if (rl->rlim_cur >= RLIM_INFINITY) 55 else if (rl->rlim_cur >= RLIM_INFINITY)
55- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max); 56- (void) asprintf(&s, "infinity:" RLIM_FMT, rl->rlim_max);
56+ (void) asprintf(&s, "infinity:%ju", (uintmax_t)rl->rlim_max); 57+ (void) asprintf(&s, "infinity:" RLIM_FMT, (uintmax_t)rl->rlim_max);
57 else if (rl->rlim_max >= RLIM_INFINITY) 58 else if (rl->rlim_max >= RLIM_INFINITY)
58- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur); 59- (void) asprintf(&s, RLIM_FMT ":infinity", rl->rlim_cur);
59+ (void) asprintf(&s, "%ju:infinity", (uintmax_t)rl->rlim_cur); 60+ (void) asprintf(&s, RLIM_FMT ":infinity", (uintmax_t)rl->rlim_cur);
60 else if (rl->rlim_cur == rl->rlim_max) 61 else if (rl->rlim_cur == rl->rlim_max)
61- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur); 62- (void) asprintf(&s, RLIM_FMT, rl->rlim_cur);
62+ (void) asprintf(&s, "%ju", (uintmax_t)rl->rlim_cur); 63+ (void) asprintf(&s, RLIM_FMT, (uintmax_t)rl->rlim_cur);
63 else 64 else
64- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max); 65- (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, rl->rlim_cur, rl->rlim_max);
65+ (void) asprintf(&s, "%ju:%ju", (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max); 66+ (void) asprintf(&s, RLIM_FMT ":" RLIM_FMT, (uintmax_t)rl->rlim_cur, (uintmax_t)rl->rlim_max);
66 67
67 if (!s) 68 if (!s)
68 return -ENOMEM; 69 return -ENOMEM;
70@@ -404,7 +404,7 @@ int rlimit_nofile_safe(void) {
71
72 rl.rlim_cur = FD_SETSIZE;
73 if (setrlimit(RLIMIT_NOFILE, &rl) < 0)
74- return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", rl.rlim_cur);
75+ return log_debug_errno(errno, "Failed to lower RLIMIT_NOFILE's soft limit to " RLIM_FMT ": %m", (uintmax_t)rl.rlim_cur);
76
77 return 1;
78 }
69diff --git a/src/core/execute.c b/src/core/execute.c 79diff --git a/src/core/execute.c b/src/core/execute.c
70index 8ac69d1a0..efedf3842 100644 80index a708231..e2b8748 100644
71--- a/src/core/execute.c 81--- a/src/core/execute.c
72+++ b/src/core/execute.c 82+++ b/src/core/execute.c
73@@ -3976,10 +3976,10 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) { 83@@ -4220,9 +4220,9 @@ void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix) {
74
75 for (i = 0; i < RLIM_NLIMITS; i++) 84 for (i = 0; i < RLIM_NLIMITS; i++)
76 if (c->rlimit[i]) { 85 if (c->rlimit[i]) {
77- fprintf(f, "Limit%s%s: " RLIM_FMT "\n", 86 fprintf(f, "%sLimit%s: " RLIM_FMT "\n",
78- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max); 87- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_max);
79- fprintf(f, "Limit%s%sSoft: " RLIM_FMT "\n",
80- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
81+ fprintf(f, "Limit%s%s: %ju\n",
82+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max); 88+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_max);
83+ fprintf(f, "Limit%s%sSoft: %ju\n", 89 fprintf(f, "%sLimit%sSoft: " RLIM_FMT "\n",
90- prefix, rlimit_to_string(i), c->rlimit[i]->rlim_cur);
84+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur); 91+ prefix, rlimit_to_string(i), (uintmax_t)c->rlimit[i]->rlim_cur);
85 } 92 }
86 93
87 if (c->ioprio_set) { 94 if (c->ioprio_set) {
88-- 95--
892.11.0 962.7.4
90 97
diff --git a/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch b/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
deleted file mode 100644
index 1a22ffd9e9..0000000000
--- a/meta/recipes-core/systemd/systemd/0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch
+++ /dev/null
@@ -1,48 +0,0 @@
1From 045f205fd21e5e380edf813de04fcfbf5a487219 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 2 Jul 2018 13:28:25 +0800
4Subject: [PATCH 11/19] src/basic/missing.h: check for missing __compar_fn_t
5 typedef
6
7include missing.h for missing __compar_fn_t
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13---
14 src/basic/missing.h | 5 +++++
15 src/basic/strbuf.c | 1 +
16 2 files changed, 6 insertions(+)
17
18diff --git a/src/basic/missing.h b/src/basic/missing.h
19index 6dc750eba..cd1cc109f 100644
20--- a/src/basic/missing.h
21+++ b/src/basic/missing.h
22@@ -1179,6 +1179,11 @@ struct input_mask {
23 #define RENAME_NOREPLACE (1 << 0)
24 #endif
25
26+#ifndef __COMPAR_FN_T
27+#define __COMPAR_FN_T
28+typedef int (*__compar_fn_t)(const void *, const void *);
29+#endif
30+
31 #ifndef KCMP_FILE
32 #define KCMP_FILE 0
33 #endif
34diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c
35index e2ed776a0..4d3ebec4c 100644
36--- a/src/basic/strbuf.c
37+++ b/src/basic/strbuf.c
38@@ -7,6 +7,7 @@
39 #include "alloc-util.h"
40 #include "strbuf.h"
41 #include "util.h"
42+#include "missing.h"
43
44 /*
45 * Strbuf stores given strings in a single continuous allocated memory
46--
472.11.0
48
diff --git a/meta/recipes-core/systemd/systemd/0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch b/meta/recipes-core/systemd/systemd/0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
new file mode 100644
index 0000000000..dbaae4f398
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
@@ -0,0 +1,27 @@
1From aa6cd19ae428769a38fe7d95f98db0a9c19ae90a Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:14:49 +0800
4Subject: [PATCH 12/24] fix missing ULONG_LONG_MAX definition in case of musl
5
6Upstream-Status: Inappropriate [musl]
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 src/basic/missing_type.h | 4 ++++
11 1 file changed, 4 insertions(+)
12
13diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
14index 23602eb..7d7c1e4 100644
15--- a/src/basic/missing_type.h
16+++ b/src/basic/missing_type.h
17@@ -39,3 +39,7 @@ typedef int (*__compar_fn_t)(const void *, const void *);
18 #ifndef FTW_SKIP_SIBLINGS
19 #define FTW_SKIP_SIBLINGS 3
20 #endif
21+
22+#ifndef ULONG_LONG_MAX
23+#define ULONG_LONG_MAX ULLONG_MAX
24+#endif
25--
262.7.4
27
diff --git a/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch b/meta/recipes-core/systemd/systemd/0013-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
index c7ca9cd4bd..874c17c420 100644
--- a/meta/recipes-core/systemd/systemd/0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
+++ b/meta/recipes-core/systemd/systemd/0013-test-hexdecoct.c-Include-missing.h-for-strndupa.patch
@@ -1,7 +1,7 @@
1From b11109ecc41110c518a98b6ac39611ff86477021 Mon Sep 17 00:00:00 2001 1From e5a48f84db58ffb9128383eaefc123b5829523e5 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Mon, 23 Oct 2017 12:33:22 -0700 3Date: Mon, 23 Oct 2017 12:33:22 -0700
4Subject: [PATCH 15/19] test-hexdecoct.c: Include missing.h for strndupa 4Subject: [PATCH 13/24] test-hexdecoct.c: Include missing.h for strndupa
5 5
6Upstream-Status: Inappropriate [musl specific] 6Upstream-Status: Inappropriate [musl specific]
7 7
@@ -12,7 +12,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12 1 file changed, 1 insertion(+) 12 1 file changed, 1 insertion(+)
13 13
14diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c 14diff --git a/src/test/test-hexdecoct.c b/src/test/test-hexdecoct.c
15index da9f3008b..7ff2dfe0c 100644 15index 5221742..a05e778 100644
16--- a/src/test/test-hexdecoct.c 16--- a/src/test/test-hexdecoct.c
17+++ b/src/test/test-hexdecoct.c 17+++ b/src/test/test-hexdecoct.c
18@@ -6,6 +6,7 @@ 18@@ -6,6 +6,7 @@
@@ -24,5 +24,5 @@ index da9f3008b..7ff2dfe0c 100644
24 static void test_hexchar(void) { 24 static void test_hexchar(void) {
25 assert_se(hexchar(0xa) == 'a'); 25 assert_se(hexchar(0xa) == 'a');
26-- 26--
272.11.0 272.7.4
28 28
diff --git a/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch b/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
deleted file mode 100644
index 258a631cad..0000000000
--- a/meta/recipes-core/systemd/systemd/0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From cb59b3af54fb3bbd4d8264fef919810af8d08d16 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 27 Feb 2018 14:01:30 +0800
4Subject: [PATCH 14/19] fix missing ULONG_LONG_MAX definition in case of musl
5
6Upstream-Status: Inappropriate [musl]
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 src/basic/missing.h | 4 ++++
11 1 file changed, 4 insertions(+)
12
13diff --git a/src/basic/missing.h b/src/basic/missing.h
14index cd1cc109f..144058a1a 100644
15--- a/src/basic/missing.h
16+++ b/src/basic/missing.h
17@@ -54,6 +54,10 @@ struct sockaddr_vm {
18 };
19 #endif /* !HAVE_LINUX_VM_SOCKETS_H */
20
21+#ifndef ULONG_LONG_MAX
22+#define ULONG_LONG_MAX ULLONG_MAX
23+#endif
24+
25 #ifndef RLIMIT_RTTIME
26 #define RLIMIT_RTTIME 15
27 #endif
28--
292.11.0
30
diff --git a/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch b/meta/recipes-core/systemd/systemd/0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
index c06a3706e9..914589dbd3 100644
--- a/meta/recipes-core/systemd/systemd/0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
+++ b/meta/recipes-core/systemd/systemd/0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch
@@ -1,7 +1,7 @@
1From c4bbf3efefffe0a4efadbf4e3f0adb54d76fe0e7 Mon Sep 17 00:00:00 2001 1From d3d65d4036670cbd5129fe55c09ca391286ef4b3 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 28 Feb 2018 21:25:22 -0800 3Date: Wed, 28 Feb 2018 21:25:22 -0800
4Subject: [PATCH 16/19] test-sizeof.c: Disable tests for missing typedefs in 4Subject: [PATCH 14/24] test-sizeof.c: Disable tests for missing typedefs in
5 musl 5 musl
6 6
7Upstream-Status: Inappropriate [musl specific] 7Upstream-Status: Inappropriate [musl specific]
@@ -13,10 +13,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
13 1 file changed, 4 insertions(+) 13 1 file changed, 4 insertions(+)
14 14
15diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c 15diff --git a/src/test/test-sizeof.c b/src/test/test-sizeof.c
16index 7a1e496ed..386b314d5 100644 16index 35b0876..e78e7ca 100644
17--- a/src/test/test-sizeof.c 17--- a/src/test/test-sizeof.c
18+++ b/src/test/test-sizeof.c 18+++ b/src/test/test-sizeof.c
19@@ -40,8 +40,10 @@ int main(void) { 19@@ -41,8 +41,10 @@ int main(void) {
20 info(unsigned); 20 info(unsigned);
21 info(long unsigned); 21 info(long unsigned);
22 info(long long unsigned); 22 info(long long unsigned);
@@ -27,7 +27,7 @@ index 7a1e496ed..386b314d5 100644
27 27
28 info(float); 28 info(float);
29 info(double); 29 info(double);
30@@ -59,7 +61,9 @@ int main(void) { 30@@ -60,7 +62,9 @@ int main(void) {
31 info(ssize_t); 31 info(ssize_t);
32 info(time_t); 32 info(time_t);
33 info(usec_t); 33 info(usec_t);
@@ -38,5 +38,5 @@ index 7a1e496ed..386b314d5 100644
38 info(uid_t); 38 info(uid_t);
39 info(gid_t); 39 info(gid_t);
40-- 40--
412.11.0 412.7.4
42 42
diff --git a/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch b/meta/recipes-core/systemd/systemd/0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
index 8e47c6f50a..fd407f604d 100644
--- a/meta/recipes-core/systemd/systemd/0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
+++ b/meta/recipes-core/systemd/systemd/0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch
@@ -1,7 +1,7 @@
1From 91bb4f5c9c11464468e8d3fa4746d98d59997264 Mon Sep 17 00:00:00 2001 1From 48c628f532f6025c2d1646b6819cd81eb789d7fb Mon Sep 17 00:00:00 2001
2From: Andre McCurdy <armccurdy@gmail.com> 2From: Andre McCurdy <armccurdy@gmail.com>
3Date: Tue, 10 Oct 2017 14:33:30 -0700 3Date: Tue, 10 Oct 2017 14:33:30 -0700
4Subject: [PATCH 17/19] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat() 4Subject: [PATCH 15/24] don't pass AT_SYMLINK_NOFOLLOW flag to faccessat()
5 5
6Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right 6Avoid using AT_SYMLINK_NOFOLLOW flag. It doesn't seem like the right
7thing to do and it's not portable (not supported by musl). See: 7thing to do and it's not portable (not supported by musl). See:
@@ -31,7 +31,7 @@ Signed-off-by: Andre McCurdy <armccurdy@gmail.com>
31 2 files changed, 24 insertions(+), 4 deletions(-) 31 2 files changed, 24 insertions(+), 4 deletions(-)
32 32
33diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h 33diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h
34index 28566773c..14b864cc5 100644 34index 7ad030b..d4cb1e9 100644
35--- a/src/basic/fs-util.h 35--- a/src/basic/fs-util.h
36+++ b/src/basic/fs-util.h 36+++ b/src/basic/fs-util.h
37@@ -32,7 +32,27 @@ int fchmod_opath(int fd, mode_t m); 37@@ -32,7 +32,27 @@ int fchmod_opath(int fd, mode_t m);
@@ -64,7 +64,7 @@ index 28566773c..14b864cc5 100644
64 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode); 64 int touch_file(const char *path, bool parents, usec_t stamp, uid_t uid, gid_t gid, mode_t mode);
65 int touch(const char *path); 65 int touch(const char *path);
66diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c 66diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
67index 89d7a7d59..34b4ad53a 100644 67index 89d7a7d..34b4ad5 100644
68--- a/src/shared/base-filesystem.c 68--- a/src/shared/base-filesystem.c
69+++ b/src/shared/base-filesystem.c 69+++ b/src/shared/base-filesystem.c
70@@ -53,7 +53,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) { 70@@ -53,7 +53,7 @@ int base_filesystem_create(const char *root, uid_t uid, gid_t gid) {
@@ -95,5 +95,5 @@ index 89d7a7d59..34b4ad53a 100644
95 } 95 }
96 96
97-- 97--
982.11.0 982.7.4
99 99
diff --git a/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch b/meta/recipes-core/systemd/systemd/0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch
index 1bd0d602a5..d5565698aa 100644
--- a/meta/recipes-core/systemd/systemd/0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch
+++ b/meta/recipes-core/systemd/systemd/0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch
@@ -1,7 +1,7 @@
1From 97fed07132533a1b2bce9c60e305a5d09aee2e9b Mon Sep 17 00:00:00 2001 1From af76c973e41929360a6e021f2ff9a7fc1d7994e9 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com> 2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 27 May 2018 08:36:44 -0700 3Date: Sun, 27 May 2018 08:36:44 -0700
4Subject: [PATCH 18/19] Define glibc compatible basename() for non-glibc 4Subject: [PATCH 16/24] Define glibc compatible basename() for non-glibc
5 systems 5 systems
6 6
7Fixes builds with musl, even though systemd is adamant about 7Fixes builds with musl, even though systemd is adamant about
@@ -15,7 +15,7 @@ Signed-off-by: Khem Raj <raj.khem@gmail.com>
15 1 file changed, 4 insertions(+) 15 1 file changed, 4 insertions(+)
16 16
17diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c 17diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
18index 7f41465cc..cee8a5d43 100644 18index 7a558df..eca7d4b 100644
19--- a/src/machine/machine-dbus.c 19--- a/src/machine/machine-dbus.c
20+++ b/src/machine/machine-dbus.c 20+++ b/src/machine/machine-dbus.c
21@@ -11,6 +11,10 @@ 21@@ -11,6 +11,10 @@
@@ -30,5 +30,5 @@ index 7f41465cc..cee8a5d43 100644
30 #include "bus-common-errors.h" 30 #include "bus-common-errors.h"
31 #include "bus-internal.h" 31 #include "bus-internal.h"
32-- 32--
332.11.0 332.7.4
34 34
diff --git a/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch b/meta/recipes-core/systemd/systemd/0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
index 942f4c0918..05e6ded71d 100644
--- a/meta/recipes-core/systemd/systemd/0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
+++ b/meta/recipes-core/systemd/systemd/0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch
@@ -1,7 +1,7 @@
1From 8440348bcac34249cdf6ac2dcae9ac66d3c727db Mon Sep 17 00:00:00 2001 1From c7a4efb8bccb52e1714c151929c23e12bde59b82 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Wed, 4 Jul 2018 15:00:44 +0800 3Date: Wed, 4 Jul 2018 15:00:44 +0800
4Subject: [PATCH 19/19] Do not disable buffering when writing to oom_score_adj 4Subject: [PATCH 17/24] Do not disable buffering when writing to oom_score_adj
5 5
6On musl, disabling buffering when writing to oom_score_adj will 6On musl, disabling buffering when writing to oom_score_adj will
7cause the following error. 7cause the following error.
@@ -22,10 +22,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
22 1 file changed, 1 insertion(+), 1 deletion(-) 22 1 file changed, 1 insertion(+), 1 deletion(-)
23 23
24diff --git a/src/basic/process-util.c b/src/basic/process-util.c 24diff --git a/src/basic/process-util.c b/src/basic/process-util.c
25index 3543bc045..d0572e034 100644 25index aec2daf..7b4aabf 100644
26--- a/src/basic/process-util.c 26--- a/src/basic/process-util.c
27+++ b/src/basic/process-util.c 27+++ b/src/basic/process-util.c
28@@ -1473,7 +1473,7 @@ int set_oom_score_adjust(int value) { 28@@ -1538,7 +1538,7 @@ int set_oom_score_adjust(int value) {
29 sprintf(t, "%i", value); 29 sprintf(t, "%i", value);
30 30
31 return write_string_file("/proc/self/oom_score_adj", t, 31 return write_string_file("/proc/self/oom_score_adj", t,
@@ -35,5 +35,5 @@ index 3543bc045..d0572e034 100644
35 35
36 static const char *const ioprio_class_table[] = { 36 static const char *const ioprio_class_table[] = {
37-- 37--
382.11.0 382.7.4
39 39
diff --git a/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch b/meta/recipes-core/systemd/systemd/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
index 5c78cabbaf..5901772998 100644
--- a/meta/recipes-core/systemd/systemd/0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
+++ b/meta/recipes-core/systemd/systemd/0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch
@@ -1,7 +1,7 @@
1From dd53dc9b9542cbd2c39a39096941dfed70d06506 Mon Sep 17 00:00:00 2001 1From fffb2810611b4a26f5c6c0958093b5b3b7d4cd99 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com> 2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Tue, 10 Jul 2018 15:40:17 +0800 3Date: Tue, 10 Jul 2018 15:40:17 +0800
4Subject: [PATCH 20/20] distinguish XSI-compliant strerror_r from GNU-specifi 4Subject: [PATCH 18/24] distinguish XSI-compliant strerror_r from GNU-specifi
5 strerror_r 5 strerror_r
6 6
7XSI-compliant strerror_r and GNU-specifi strerror_r are different. 7XSI-compliant strerror_r and GNU-specifi strerror_r are different.
@@ -24,7 +24,7 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
24 2 files changed, 10 insertions(+) 24 2 files changed, 10 insertions(+)
25 25
26diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c 26diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
27index 65bcbcd2e..aef80dd8f 100644 27index 3fea912..4f1e592 100644
28--- a/src/journal/journal-send.c 28--- a/src/journal/journal-send.c
29+++ b/src/journal/journal-send.c 29+++ b/src/journal/journal-send.c
30@@ -337,7 +337,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove 30@@ -337,7 +337,12 @@ static int fill_iovec_perror_and_send(const char *message, int skip, struct iove
@@ -41,10 +41,10 @@ index 65bcbcd2e..aef80dd8f 100644
41 char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1]; 41 char error[STRLEN("ERRNO=") + DECIMAL_STR_MAX(int) + 1];
42 42
43diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c 43diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
44index ec359ac13..d2aa86cea 100644 44index dc95237..bdda30f 100644
45--- a/src/libsystemd/sd-bus/bus-error.c 45--- a/src/libsystemd/sd-bus/bus-error.c
46+++ b/src/libsystemd/sd-bus/bus-error.c 46+++ b/src/libsystemd/sd-bus/bus-error.c
47@@ -362,7 +362,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) { 47@@ -379,7 +379,12 @@ static void bus_error_strerror(sd_bus_error *e, int error) {
48 return; 48 return;
49 49
50 errno = 0; 50 errno = 0;
@@ -58,5 +58,5 @@ index ec359ac13..d2aa86cea 100644
58 free(m); 58 free(m);
59 k *= 2; 59 k *= 2;
60-- 60--
612.11.0 612.7.4
62 62
diff --git a/meta/recipes-core/systemd/systemd/0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/meta/recipes-core/systemd/systemd/0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
new file mode 100644
index 0000000000..35cc66ff66
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
@@ -0,0 +1,35 @@
1From 969ab9e68249fd383f4b513b1c9306bdac4ae9b2 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:18:00 +0800
4Subject: [PATCH 19/24] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
5
6for currently unknown reasons they get exported to the shared libries
7even without being listed in the sym file
8
9Upstream-Status: Pending
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12[Rebased for v241]
13Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
14---
15 src/libsystemd/sd-bus/bus-error.c | 4 ++--
16 1 file changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
19index bdda30f..e21853c 100644
20--- a/src/libsystemd/sd-bus/bus-error.c
21+++ b/src/libsystemd/sd-bus/bus-error.c
22@@ -54,8 +54,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
23 };
24
25 /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
26-extern const sd_bus_error_map __start_SYSTEMD_BUS_ERROR_MAP[];
27-extern const sd_bus_error_map __stop_SYSTEMD_BUS_ERROR_MAP[];
28+extern const sd_bus_error_map __start_SYSTEMD_BUS_ERROR_MAP[] _hidden_;
29+extern const sd_bus_error_map __stop_SYSTEMD_BUS_ERROR_MAP[] _hidden_;
30
31 /* Additional maps registered with sd_bus_error_add_map() are in this
32 * NULL terminated array */
33--
342.7.4
35
diff --git a/meta/recipes-core/systemd/systemd/0020-missing_type.h-add-__compar_d_fn_t-definition.patch b/meta/recipes-core/systemd/systemd/0020-missing_type.h-add-__compar_d_fn_t-definition.patch
new file mode 100644
index 0000000000..753d5116ac
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0020-missing_type.h-add-__compar_d_fn_t-definition.patch
@@ -0,0 +1,30 @@
1From 75c06e3e2a4760b36fffd95cdf5535b8ad73c481 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:27:54 +0800
4Subject: [PATCH 20/24] missing_type.h: add __compar_d_fn_t definition
5
6Fix the following compile failure:
7src/basic/util.h:71:18: error: unknown type name '__compar_d_fn_t'; did you mean '__compar_fn_t'?
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/basic/missing_type.h | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/src/basic/missing_type.h b/src/basic/missing_type.h
17index 7d7c1e4..85902ab 100644
18--- a/src/basic/missing_type.h
19+++ b/src/basic/missing_type.h
20@@ -13,6 +13,7 @@
21
22 #ifndef __GLIBC__
23 typedef int (*comparison_fn_t)(const void *, const void *);
24+typedef int (*__compar_d_fn_t) (const void *, const void *, void *);
25 #endif
26
27 #ifndef __COMPAR_FN_T
28--
292.7.4
30
diff --git a/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch b/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
deleted file mode 100644
index 668f273208..0000000000
--- a/meta/recipes-core/systemd/systemd/0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch
+++ /dev/null
@@ -1,34 +0,0 @@
1From 687a5af8dc5d38f918a6ce08fed5297234bf8346 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 2 Mar 2018 18:00:17 -0800
4Subject: [PATCH] Hide __start_BUS_ERROR_MAP and __stop_BUS_ERROR_MAP
5
6for currently unknown reasons they get exported to the shared libries
7even without being listed in the sym file
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11
12Upstream-Status: Pending [ Conditional on master needing this, 239 does need it ]
13
14 src/libsystemd/sd-bus/bus-error.c | 4 ++--
15 1 file changed, 2 insertions(+), 2 deletions(-)
16
17diff --git a/src/libsystemd/sd-bus/bus-error.c b/src/libsystemd/sd-bus/bus-error.c
18index 378f7a377..49d797abd 100644
19--- a/src/libsystemd/sd-bus/bus-error.c
20+++ b/src/libsystemd/sd-bus/bus-error.c
21@@ -71,8 +71,8 @@ BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
22 };
23
24 /* GCC maps this magically to the beginning and end of the BUS_ERROR_MAP section */
25-extern const sd_bus_error_map __start_BUS_ERROR_MAP[];
26-extern const sd_bus_error_map __stop_BUS_ERROR_MAP[];
27+extern const sd_bus_error_map __start_BUS_ERROR_MAP[] _hidden_;
28+extern const sd_bus_error_map __stop_BUS_ERROR_MAP[] _hidden_;
29
30 /* Additional maps registered with sd_bus_error_add_map() are in this
31 * NULL terminated array */
32--
332.16.2
34
diff --git a/meta/recipes-core/systemd/systemd/0021-avoid-redefinition-of-prctl_mm_map-structure.patch b/meta/recipes-core/systemd/systemd/0021-avoid-redefinition-of-prctl_mm_map-structure.patch
new file mode 100644
index 0000000000..a8c53c9314
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0021-avoid-redefinition-of-prctl_mm_map-structure.patch
@@ -0,0 +1,47 @@
1From 3fbf61d54b82fc9bf21d8039bfd89dc9efc5bbcd Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:44:54 +0800
4Subject: [PATCH 21/24] avoid redefinition of prctl_mm_map structure
5
6Fix the following compile failure:
7error: redefinition of 'struct prctl_mm_map'
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/basic/missing_prctl.h | 2 ++
14 src/basic/util.h | 3 ++-
15 2 files changed, 4 insertions(+), 1 deletion(-)
16
17diff --git a/src/basic/missing_prctl.h b/src/basic/missing_prctl.h
18index f80cd17..47e4893 100644
19--- a/src/basic/missing_prctl.h
20+++ b/src/basic/missing_prctl.h
21@@ -1,7 +1,9 @@
22 /* SPDX-License-Identifier: LGPL-2.1+ */
23 #pragma once
24
25+#ifdef __GLIBC__
26 #include <linux/prctl.h>
27+#endif
28
29 /* 58319057b7847667f0c9585b9de0e8932b0fdb08 (4.3) */
30 #ifndef PR_CAP_AMBIENT
31diff --git a/src/basic/util.h b/src/basic/util.h
32index 2c5dc32..f721184 100644
33--- a/src/basic/util.h
34+++ b/src/basic/util.h
35@@ -26,7 +26,8 @@
36 #include "format-util.h"
37 #include "macro.h"
38 #include "time-util.h"
39-#include "missing.h"
40+#include "missing_stdlib.h"
41+#include "missing_type.h"
42
43 size_t page_size(void) _pure_;
44 #define PAGE_ALIGN(l) ALIGN_TO((l), page_size())
45--
462.7.4
47
diff --git a/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch b/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch
deleted file mode 100644
index a9c1c9cfe5..0000000000
--- a/meta/recipes-core/systemd/systemd/0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch
+++ /dev/null
@@ -1,28 +0,0 @@
1From 4f07ffa8f5ab85011422bb7114f1cddf49d4923d Mon Sep 17 00:00:00 2001
2From: ChenQi1989 <40684930+ChenQi1989@users.noreply.github.com>
3Date: Fri, 29 Jun 2018 06:54:07 +0000
4Subject: Use #if instead of #ifdef for ENABLE_GSHADOW
5
6ENABLE_GSHADOW is defined to be 0 or 1. So #if should be used instead of #ifdef.
7
8Upstream-Status: Backport [https://github.com/systemd/systemd/commit/4f07ffa8f5ab85011422bb7114f1cddf49d4923d]
9---
10 src/basic/user-util.h | 2 +-
11 1 file changed, 1 insertion(+), 1 deletion(-)
12
13diff --git a/src/basic/user-util.h b/src/basic/user-util.h
14index b74f16885..b2f198c89 100644
15--- a/src/basic/user-util.h
16+++ b/src/basic/user-util.h
17@@ -102,7 +102,7 @@ int fgetgrent_sane(FILE *stream, struct group **gr);
18 int putpwent_sane(const struct passwd *pw, FILE *stream);
19 int putspent_sane(const struct spwd *sp, FILE *stream);
20 int putgrent_sane(const struct group *gr, FILE *stream);
21-#ifdef ENABLE_GSHADOW
22+#if ENABLE_GSHADOW
23 int fgetsgent_sane(FILE *stream, struct sgrp **sg);
24 int putsgent_sane(const struct sgrp *sg, FILE *stream);
25 #endif
26--
272.18.1
28
diff --git a/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch b/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
deleted file mode 100644
index 962463f0b8..0000000000
--- a/meta/recipes-core/systemd/systemd/0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch
+++ /dev/null
@@ -1,109 +0,0 @@
1From 75720bff62a84896e9a0654afc7cf9408cf89a38 Mon Sep 17 00:00:00 2001
2From: Filipe Brandenburger <filbranden@google.com>
3Date: Sun, 15 Jul 2018 22:43:35 -0700
4Subject: [PATCH] build-sys: Detect whether struct statx is defined in
5 sys/stat.h
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10Starting with glibc 2.27.9000-36.fc29, include file sys/stat.h will have a
11definition for struct statx, in which case include file linux/stat.h should be
12avoided, in order to prevent a duplicate definition.
13
14 In file included from ../src/basic/missing.h:18,
15 from ../src/basic/util.h:28,
16 from ../src/basic/hashmap.h:10,
17 from ../src/shared/bus-util.h:12,
18 from ../src/libsystemd/sd-bus/bus-creds.c:11:
19 /usr/include/linux/stat.h:99:8: error: redefinition of ‘struct statx’
20 struct statx {
21 ^~~~~
22 In file included from /usr/include/sys/stat.h:446,
23 from ../src/basic/util.h:19,
24 from ../src/basic/hashmap.h:10,
25 from ../src/shared/bus-util.h:12,
26 from ../src/libsystemd/sd-bus/bus-creds.c:11:
27 /usr/include/bits/statx.h:36:8: note: originally defined here
28 struct statx
29 ^~~~~
30
31Extend our meson.build to look for struct statx when only sys/stat.h is
32included and, in that case, do not include linux/stat.h anymore.
33
34Tested that systemd builds correctly when using a glibc version that includes a
35definition for struct statx.
36
37glibc Fedora RPM update:
38https://src.fedoraproject.org/rpms/glibc/c/28cb5d31fc1e5887912283c889689c47076278ae
39
40glibc upstream commit:
41https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=fd70af45528d59a00eb3190ef6706cb299488fcd
42---
43
44Upstream-Status: Pending
45Signed-off-by: Khem Raj <raj.khem@gmail.com>
46
47 meson.build | 5 +++++
48 src/basic/missing.h | 5 ++++-
49 src/basic/xattr-util.c | 1 -
50 3 files changed, 9 insertions(+), 2 deletions(-)
51
52Index: git/meson.build
53===================================================================
54--- git.orig/meson.build
55+++ git/meson.build
56@@ -432,6 +432,7 @@ decl_headers = '''
57 #include <sys/stat.h>
58 '''
59 # FIXME: key_serial_t is only defined in keyutils.h, this is bound to fail
60+# FIXME: these should use -D_GNU_SOURCE, since that is defined at build time
61
62 foreach decl : ['char16_t',
63 'char32_t',
64@@ -446,6 +447,10 @@ foreach decl : ['char16_t',
65 conf.set10('HAVE_' + decl.underscorify().to_upper(), have)
66 endforeach
67
68+conf.set10('HAVE_STRUCT_STATX_IN_SYS_STAT_H', cc.sizeof('struct statx', prefix : '''
69+#include <sys/stat.h>
70+''', args : '-D_GNU_SOURCE') > 0)
71+
72 foreach decl : [['IFLA_INET6_ADDR_GEN_MODE', 'linux/if_link.h'],
73 ['IN6_ADDR_GEN_MODE_STABLE_PRIVACY', 'linux/if_link.h'],
74 ['IFLA_VRF_TABLE', 'linux/if_link.h'],
75Index: git/src/basic/missing.h
76===================================================================
77--- git.orig/src/basic/missing.h
78+++ git/src/basic/missing.h
79@@ -15,7 +15,6 @@
80 #include <linux/neighbour.h>
81 #include <linux/oom.h>
82 #include <linux/rtnetlink.h>
83-#include <linux/stat.h>
84 #include <net/ethernet.h>
85 #include <stdlib.h>
86 #include <sys/resource.h>
87@@ -25,6 +24,10 @@
88 #include <uchar.h>
89 #include <unistd.h>
90
91+#if !HAVE_STRUCT_STATX_IN_SYS_STAT_H
92+#include <linux/stat.h>
93+#endif
94+
95 #if HAVE_AUDIT
96 #include <libaudit.h>
97 #endif
98Index: git/src/basic/xattr-util.c
99===================================================================
100--- git.orig/src/basic/xattr-util.c
101+++ git/src/basic/xattr-util.c
102@@ -2,7 +2,6 @@
103
104 #include <errno.h>
105 #include <fcntl.h>
106-#include <linux/stat.h>
107 #include <stdint.h>
108 #include <stdlib.h>
109 #include <string.h>
diff --git a/meta/recipes-core/systemd/systemd/0022-include-sys-wait.h-to-avoid-compile-failure.patch b/meta/recipes-core/systemd/systemd/0022-include-sys-wait.h-to-avoid-compile-failure.patch
new file mode 100644
index 0000000000..47212bc3c1
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0022-include-sys-wait.h-to-avoid-compile-failure.patch
@@ -0,0 +1,33 @@
1From 6c5364736f5afd1106ac240f03806af53979cc60 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 15:56:50 +0800
4Subject: [PATCH 22/24] include sys/wait.h to avoid compile failure
5
6Fix the following error:
7src/udev/udev-event.c:581:53: error: 'WEXITED' undeclared (first use in this function); did you mean 'WIFEXITED'?
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/udev/udev-event.c | 4 +++-
14 1 file changed, 3 insertions(+), 1 deletion(-)
15
16diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
17index 07b7365..e532bb7 100644
18--- a/src/udev/udev-event.c
19+++ b/src/udev/udev-event.c
20@@ -8,7 +8,9 @@
21 #include <stdio.h>
22 #include <stdlib.h>
23 #include <unistd.h>
24-
25+#ifndef __GLIBC__
26+#include <sys/wait.h>
27+#endif
28 #include "sd-event.h"
29
30 #include "alloc-util.h"
31--
322.7.4
33
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
deleted file mode 100644
index 2f3e776aa0..0000000000
--- a/meta/recipes-core/systemd/systemd/0023-resolvconf-fixes-for-the-compatibility-interface.patch
+++ /dev/null
@@ -1,58 +0,0 @@
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/0023-socket-util.h-include-string.h.patch b/meta/recipes-core/systemd/systemd/0023-socket-util.h-include-string.h.patch
new file mode 100644
index 0000000000..22186b8a7e
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0023-socket-util.h-include-string.h.patch
@@ -0,0 +1,30 @@
1From 93e6b81b721d9eb966a257bfdf7df6e8280b885c Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 16:37:19 +0800
4Subject: [PATCH 23/24] socket-util.h: include string.h
5
6Fix the following compile error:
7src/basic/socket-util.h:187:30: error: implicit declaration of function 'strnlen'; did you mean 'strlen'? [-Werror=implicit-function-declaration]
8
9Upstream-Status: Pending
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/basic/socket-util.h | 1 +
14 1 file changed, 1 insertion(+)
15
16diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h
17index 574d2b7..097aa4d 100644
18--- a/src/basic/socket-util.h
19+++ b/src/basic/socket-util.h
20@@ -12,6 +12,7 @@
21 #include <sys/socket.h>
22 #include <sys/types.h>
23 #include <sys/un.h>
24+#include <string.h>
25
26 #include "macro.h"
27 #include "missing_socket.h"
28--
292.7.4
30
diff --git a/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch b/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch
deleted file mode 100644
index c2f78be39e..0000000000
--- a/meta/recipes-core/systemd/systemd/0024-journald-do-not-store-the-iovec-entry-for-process-co.patch
+++ /dev/null
@@ -1,208 +0,0 @@
1From 9cb07e7d82c7c4f28bbaa1478e1387e8ea3d03dd Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Wed, 5 Dec 2018 18:38:39 +0100
4Subject: [PATCH] journald: do not store the iovec entry for process
5 commandline on stack
6
7This fixes a crash where we would read the commandline, whose length is under
8control of the sending program, and then crash when trying to create a stack
9allocation for it.
10
11CVE-2018-16864
12https://bugzilla.redhat.com/show_bug.cgi?id=1653855
13
14The message actually doesn't get written to disk, because
15journal_file_append_entry() returns -E2BIG.
16
17Patch backported from systemd master at
18084eeb865ca63887098e0945fb4e93c852b91b0f.
19
20CVE: CVE-2018-16864
21Upstream-Status: Backport
22Signed-off-by: Marcus Cooper <marcusc@axis.com>
23---
24 src/basic/io-util.c | 10 ++++++++++
25 src/basic/io-util.h | 2 ++
26 src/coredump/coredump.c | 31 +++++++++++--------------------
27 src/journal/journald-server.c | 25 +++++++++++++++----------
28 4 files changed, 38 insertions(+), 30 deletions(-)
29
30diff --git a/src/basic/io-util.c b/src/basic/io-util.c
31index 1f64cc933b..575398fbe6 100644
32--- a/src/basic/io-util.c
33+++ b/src/basic/io-util.c
34@@ -8,6 +8,7 @@
35 #include <unistd.h>
36
37 #include "io-util.h"
38+#include "string-util.h"
39 #include "time-util.h"
40
41 int flush_fd(int fd) {
42@@ -252,3 +253,12 @@ ssize_t sparse_write(int fd, const void *p, size_t sz, size_t run_length) {
43
44 return q - (const uint8_t*) p;
45 }
46+
47+char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value) {
48+ char *x;
49+
50+ x = strappend(field, value);
51+ if (x)
52+ iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(x);
53+ return x;
54+}
55diff --git a/src/basic/io-util.h b/src/basic/io-util.h
56index ed189b5820..792a64ad5e 100644
57--- a/src/basic/io-util.h
58+++ b/src/basic/io-util.h
59@@ -71,3 +71,5 @@ static inline bool FILE_SIZE_VALID_OR_INFINITY(uint64_t l) {
60 #define IOVEC_MAKE(base, len) (struct iovec) IOVEC_INIT(base, len)
61 #define IOVEC_INIT_STRING(string) IOVEC_INIT((char*) string, strlen(string))
62 #define IOVEC_MAKE_STRING(string) (struct iovec) IOVEC_INIT_STRING(string)
63+
64+char* set_iovec_string_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value);
65diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c
66index 20a1cbdd45..18e4f61d72 100644
67--- a/src/coredump/coredump.c
68+++ b/src/coredump/coredump.c
69@@ -1053,19 +1053,10 @@ static int send_iovec(const struct iovec iovec[], size_t n_iovec, int input_fd)
70 return 0;
71 }
72
73-static char* set_iovec_field(struct iovec *iovec, size_t *n_iovec, const char *field, const char *value) {
74- char *x;
75-
76- x = strappend(field, value);
77- if (x)
78- iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(x);
79- return x;
80-}
81-
82 static char* set_iovec_field_free(struct iovec *iovec, size_t *n_iovec, const char *field, char *value) {
83 char *x;
84
85- x = set_iovec_field(iovec, n_iovec, field, value);
86+ x = set_iovec_string_field(iovec, n_iovec, field, value);
87 free(value);
88 return x;
89 }
90@@ -1115,36 +1106,36 @@ static int gather_pid_metadata(
91 disable_coredumps();
92 }
93
94- set_iovec_field(iovec, n_iovec, "COREDUMP_UNIT=", context[CONTEXT_UNIT]);
95+ set_iovec_string_field(iovec, n_iovec, "COREDUMP_UNIT=", context[CONTEXT_UNIT]);
96 }
97
98 if (cg_pid_get_user_unit(pid, &t) >= 0)
99 set_iovec_field_free(iovec, n_iovec, "COREDUMP_USER_UNIT=", t);
100
101 /* The next few are mandatory */
102- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_PID=", context[CONTEXT_PID]))
103+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_PID=", context[CONTEXT_PID]))
104 return log_oom();
105
106- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_UID=", context[CONTEXT_UID]))
107+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_UID=", context[CONTEXT_UID]))
108 return log_oom();
109
110- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_GID=", context[CONTEXT_GID]))
111+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_GID=", context[CONTEXT_GID]))
112 return log_oom();
113
114- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_SIGNAL=", context[CONTEXT_SIGNAL]))
115+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_SIGNAL=", context[CONTEXT_SIGNAL]))
116 return log_oom();
117
118- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_RLIMIT=", context[CONTEXT_RLIMIT]))
119+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_RLIMIT=", context[CONTEXT_RLIMIT]))
120 return log_oom();
121
122- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_HOSTNAME=", context[CONTEXT_HOSTNAME]))
123+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_HOSTNAME=", context[CONTEXT_HOSTNAME]))
124 return log_oom();
125
126- if (!set_iovec_field(iovec, n_iovec, "COREDUMP_COMM=", context[CONTEXT_COMM]))
127+ if (!set_iovec_string_field(iovec, n_iovec, "COREDUMP_COMM=", context[CONTEXT_COMM]))
128 return log_oom();
129
130 if (context[CONTEXT_EXE] &&
131- !set_iovec_field(iovec, n_iovec, "COREDUMP_EXE=", context[CONTEXT_EXE]))
132+ !set_iovec_string_field(iovec, n_iovec, "COREDUMP_EXE=", context[CONTEXT_EXE]))
133 return log_oom();
134
135 if (sd_pid_get_session(pid, &t) >= 0)
136@@ -1212,7 +1203,7 @@ static int gather_pid_metadata(
137 iovec[(*n_iovec)++] = IOVEC_MAKE_STRING(t);
138
139 if (safe_atoi(context[CONTEXT_SIGNAL], &signo) >= 0 && SIGNAL_VALID(signo))
140- set_iovec_field(iovec, n_iovec, "COREDUMP_SIGNAL_NAME=SIG", signal_to_string(signo));
141+ set_iovec_string_field(iovec, n_iovec, "COREDUMP_SIGNAL_NAME=SIG", signal_to_string(signo));
142
143 return 0; /* we successfully acquired all metadata */
144 }
145diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
146index 4f1550ec5b..31be085c6b 100644
147--- a/src/journal/journald-server.c
148+++ b/src/journal/journald-server.c
149@@ -753,6 +753,7 @@ static void dispatch_message_real(
150 pid_t object_pid) {
151
152 char source_time[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)];
153+ _cleanup_free_ char *cmdline1 = NULL, *cmdline2 = NULL;
154 uid_t journal_uid;
155 ClientContext *o;
156
157@@ -769,20 +770,23 @@ static void dispatch_message_real(
158 IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->uid, uid_t, uid_is_valid, UID_FMT, "_UID");
159 IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->gid, gid_t, gid_is_valid, GID_FMT, "_GID");
160
161- IOVEC_ADD_STRING_FIELD(iovec, n, c->comm, "_COMM");
162- IOVEC_ADD_STRING_FIELD(iovec, n, c->exe, "_EXE");
163- IOVEC_ADD_STRING_FIELD(iovec, n, c->cmdline, "_CMDLINE");
164- IOVEC_ADD_STRING_FIELD(iovec, n, c->capeff, "_CAP_EFFECTIVE");
165+ IOVEC_ADD_STRING_FIELD(iovec, n, c->comm, "_COMM"); /* At most TASK_COMM_LENGTH (16 bytes) */
166+ IOVEC_ADD_STRING_FIELD(iovec, n, c->exe, "_EXE"); /* A path, so at most PATH_MAX (4096 bytes) */
167
168- IOVEC_ADD_SIZED_FIELD(iovec, n, c->label, c->label_size, "_SELINUX_CONTEXT");
169+ if (c->cmdline)
170+ /* At most _SC_ARG_MAX (2MB usually), which is too much to put on stack.
171+ * Let's use a heap allocation for this one. */
172+ cmdline1 = set_iovec_string_field(iovec, &n, "_CMDLINE=", c->cmdline);
173
174+ IOVEC_ADD_STRING_FIELD(iovec, n, c->capeff, "_CAP_EFFECTIVE"); /* Read from /proc/.../status */
175+ IOVEC_ADD_SIZED_FIELD(iovec, n, c->label, c->label_size, "_SELINUX_CONTEXT");
176 IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->auditid, uint32_t, audit_session_is_valid, "%" PRIu32, "_AUDIT_SESSION");
177 IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->loginuid, uid_t, uid_is_valid, UID_FMT, "_AUDIT_LOGINUID");
178
179- IOVEC_ADD_STRING_FIELD(iovec, n, c->cgroup, "_SYSTEMD_CGROUP");
180+ IOVEC_ADD_STRING_FIELD(iovec, n, c->cgroup, "_SYSTEMD_CGROUP"); /* A path */
181 IOVEC_ADD_STRING_FIELD(iovec, n, c->session, "_SYSTEMD_SESSION");
182 IOVEC_ADD_NUMERIC_FIELD(iovec, n, c->owner_uid, uid_t, uid_is_valid, UID_FMT, "_SYSTEMD_OWNER_UID");
183- IOVEC_ADD_STRING_FIELD(iovec, n, c->unit, "_SYSTEMD_UNIT");
184+ IOVEC_ADD_STRING_FIELD(iovec, n, c->unit, "_SYSTEMD_UNIT"); /* Unit names are bounded by UNIT_NAME_MAX */
185 IOVEC_ADD_STRING_FIELD(iovec, n, c->user_unit, "_SYSTEMD_USER_UNIT");
186 IOVEC_ADD_STRING_FIELD(iovec, n, c->slice, "_SYSTEMD_SLICE");
187 IOVEC_ADD_STRING_FIELD(iovec, n, c->user_slice, "_SYSTEMD_USER_SLICE");
188@@ -803,13 +807,14 @@ static void dispatch_message_real(
189 IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->uid, uid_t, uid_is_valid, UID_FMT, "OBJECT_UID");
190 IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->gid, gid_t, gid_is_valid, GID_FMT, "OBJECT_GID");
191
192+ /* See above for size limits, only ->cmdline may be large, so use a heap allocation for it. */
193 IOVEC_ADD_STRING_FIELD(iovec, n, o->comm, "OBJECT_COMM");
194 IOVEC_ADD_STRING_FIELD(iovec, n, o->exe, "OBJECT_EXE");
195- IOVEC_ADD_STRING_FIELD(iovec, n, o->cmdline, "OBJECT_CMDLINE");
196- IOVEC_ADD_STRING_FIELD(iovec, n, o->capeff, "OBJECT_CAP_EFFECTIVE");
197+ if (o->cmdline)
198+ cmdline2 = set_iovec_string_field(iovec, &n, "OBJECT_CMDLINE=", o->cmdline);
199
200+ IOVEC_ADD_STRING_FIELD(iovec, n, o->capeff, "OBJECT_CAP_EFFECTIVE");
201 IOVEC_ADD_SIZED_FIELD(iovec, n, o->label, o->label_size, "OBJECT_SELINUX_CONTEXT");
202-
203 IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->auditid, uint32_t, audit_session_is_valid, "%" PRIu32, "OBJECT_AUDIT_SESSION");
204 IOVEC_ADD_NUMERIC_FIELD(iovec, n, o->loginuid, uid_t, uid_is_valid, UID_FMT, "OBJECT_AUDIT_LOGINUID");
205
206--
2072.11.0
208
diff --git a/meta/recipes-core/systemd/systemd/0024-test-json.c-define-M_PIl.patch b/meta/recipes-core/systemd/systemd/0024-test-json.c-define-M_PIl.patch
new file mode 100644
index 0000000000..c2ae2bbb7b
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/0024-test-json.c-define-M_PIl.patch
@@ -0,0 +1,33 @@
1From 902412c271e0c5d9cb93b10ec0fb5b119b393474 Mon Sep 17 00:00:00 2001
2From: Chen Qi <Qi.Chen@windriver.com>
3Date: Mon, 25 Feb 2019 16:53:06 +0800
4Subject: [PATCH 24/24] test-json.c: define M_PIl
5
6Fix the following compile failure:
7src/test/test-json.c:305:50: error: 'M_PIl' undeclared (first use in this function); did you mean 'M_PI'?
8
9Upstream-Status: Inappropriate [musl specific]
10
11Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
12---
13 src/test/test-json.c | 4 ++++
14 1 file changed, 4 insertions(+)
15
16diff --git a/src/test/test-json.c b/src/test/test-json.c
17index fdf1b4f..fa541f8 100644
18--- a/src/test/test-json.c
19+++ b/src/test/test-json.c
20@@ -10,6 +10,10 @@
21 #include "strv.h"
22 #include "util.h"
23
24+#ifndef M_PIl
25+#define M_PIl 3.141592653589793238462643383279502884L
26+#endif
27+
28 static void test_tokenizer(const char *data, ...) {
29 unsigned line = 0, column = 0;
30 void *state = NULL;
31--
322.7.4
33
diff --git a/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch b/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch
deleted file mode 100644
index ae9ef5de56..0000000000
--- a/meta/recipes-core/systemd/systemd/0025-journald-set-a-limit-on-the-number-of-fields.patch
+++ /dev/null
@@ -1,139 +0,0 @@
1From 7cad044b72406cbadf048da432c29afea74c3c10 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
3Date: Wed, 5 Dec 2018 22:45:02 +0100
4Subject: [PATCH] journald: set a limit on the number of fields
5
6The fix for CVE-2018-16865 is plucked from two commits that have
7been pushed to systemd master.
8
9journald: set a limit on the number of fields (1k)
10
11We allocate a iovec entry for each field, so with many short entries,
12our memory usage and processing time can be large, even with a relatively
13small message size. Let's refuse overly long entries.
14
15CVE-2018-16865
16https://bugzilla.redhat.com/show_bug.cgi?id=1653861
17
18What from I can see, the problem is not from an alloca, despite what the CVE
19description says, but from the attack multiplication that comes from creating
20many very small iovecs: (void* + size_t) for each three bytes of input message.
21
22Patch backported from systemd master at
23052c57f132f04a3cf4148f87561618da1a6908b4.
24
25journal-remote: set a limit on the number of fields in a message
26
27Existing use of E2BIG is replaced with ENOBUFS (entry too long), and E2BIG is
28reused for the new error condition (too many fields).
29
30This matches the change done for systemd-journald, hence forming the second
31part of the fix for CVE-2018-16865
32(https://bugzilla.redhat.com/show_bug.cgi?id=1653861).
33
34Patch backported from systemd master at
35ef4d6abe7c7fab6cbff975b32e76b09feee56074.
36with the changes applied by 7fdb237f5473cb8fc2129e57e8a0039526dcb4fd
37removed.
38
39CVE: CVE-2018-16865
40Upstream-Status: Backport
41Signed-off-by: Marcus Cooper <marcusc@axis.com>
42---
43 src/basic/journal-importer.c | 5 ++++-
44 src/basic/journal-importer.h | 3 +++
45 src/journal-remote/journal-remote-main.c | 7 ++++++-
46 src/journal-remote/journal-remote.c | 5 ++++-
47 src/journal/journald-native.c | 5 +++++
48 5 files changed, 22 insertions(+), 3 deletions(-)
49
50diff --git a/src/basic/journal-importer.c b/src/basic/journal-importer.c
51index ca203bbbfc..3ac55a66d9 100644
52--- a/src/basic/journal-importer.c
53+++ b/src/basic/journal-importer.c
54@@ -23,6 +23,9 @@ enum {
55 };
56
57 static int iovw_put(struct iovec_wrapper *iovw, void* data, size_t len) {
58+ if (iovw->count >= ENTRY_FIELD_COUNT_MAX)
59+ return -E2BIG;
60+
61 if (!GREEDY_REALLOC(iovw->iovec, iovw->size_bytes, iovw->count + 1))
62 return log_oom();
63
64@@ -98,7 +101,7 @@ static int get_line(JournalImporter *imp, char **line, size_t *size) {
65 imp->scanned = imp->filled;
66 if (imp->scanned >= DATA_SIZE_MAX) {
67 log_error("Entry is bigger than %u bytes.", DATA_SIZE_MAX);
68- return -E2BIG;
69+ return -ENOBUFS;
70 }
71
72 if (imp->passive_fd)
73diff --git a/src/basic/journal-importer.h b/src/basic/journal-importer.h
74index f49ce734a1..c4ae45d32d 100644
75--- a/src/basic/journal-importer.h
76+++ b/src/basic/journal-importer.h
77@@ -16,6 +16,9 @@
78 #define DATA_SIZE_MAX (1024*1024*768u)
79 #define LINE_CHUNK 8*1024u
80
81+/* The maximum number of fields in an entry */
82+#define ENTRY_FIELD_COUNT_MAX 1024
83+
84 struct iovec_wrapper {
85 struct iovec *iovec;
86 size_t size_bytes;
87diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c
88index 8fda9d1499..3a01fef646 100644
89--- a/src/journal-remote/journal-remote-main.c
90+++ b/src/journal-remote/journal-remote-main.c
91@@ -212,7 +212,12 @@ static int process_http_upload(
92 break;
93 else if (r < 0) {
94 log_warning("Failed to process data for connection %p", connection);
95- if (r == -E2BIG)
96+ if (r == -ENOBUFS)
97+ return mhd_respondf(connection,
98+ r, MHD_HTTP_PAYLOAD_TOO_LARGE,
99+ "Entry is above the maximum of %u, aborting connection %p.",
100+ DATA_SIZE_MAX, connection);
101+ else if (r == -E2BIG)
102 return mhd_respondf(connection,
103 r, MHD_HTTP_PAYLOAD_TOO_LARGE,
104 "Entry is too large, maximum is " STRINGIFY(DATA_SIZE_MAX) " bytes.");
105diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
106index beb75a1cb4..67e3a70c06 100644
107--- a/src/journal-remote/journal-remote.c
108+++ b/src/journal-remote/journal-remote.c
109@@ -408,7 +408,10 @@ int journal_remote_handle_raw_source(
110 log_debug("%zu active sources remaining", s->active);
111 return 0;
112 } else if (r == -E2BIG) {
113- log_notice_errno(E2BIG, "Entry too big, skipped");
114+ log_notice("Entry with too many fields, skipped");
115+ return 1;
116+ } else if (r == -ENOBUFS) {
117+ log_notice("Entry too big, skipped");
118 return 1;
119 } else if (r == -EAGAIN) {
120 return 0;
121diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
122index 5ff22a10af..951d092053 100644
123--- a/src/journal/journald-native.c
124+++ b/src/journal/journald-native.c
125@@ -140,6 +140,11 @@ static int server_process_entry(
126 }
127
128 /* A property follows */
129+ if (n > ENTRY_FIELD_COUNT_MAX) {
130+ log_debug("Received an entry that has more than " STRINGIFY(ENTRY_FIELD_COUNT_MAX) " fields, ignoring entry.");
131+ r = 1;
132+ goto finish;
133+ }
134
135 /* n existing properties, 1 new, +1 for _TRANSPORT */
136 if (!GREEDY_REALLOC(iovec, m,
137--
1382.11.0
139
diff --git a/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch b/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch
deleted file mode 100644
index 3925a4abbb..0000000000
--- a/meta/recipes-core/systemd/systemd/0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch
+++ /dev/null
@@ -1,49 +0,0 @@
1From ebd06c37d4311db9851f4d3fdd023de3dd590de0 Mon Sep 17 00:00:00 2001
2From: Filipe Brandenburger <filbranden@google.com>
3Date: Thu, 10 Jan 2019 14:53:33 -0800
4Subject: [PATCH] journal: fix out-of-bounds read CVE-2018-16866
5
6The original code didn't account for the fact that strchr() would match on the
7'\0' character, making it read past the end of the buffer if no non-whitespace
8character was present.
9
10This bug was introduced in commit ec5ff4445cca6a which was first released in
11systemd v221 and later fixed in commit 8595102d3ddde6 which was released in
12v240, so versions in the range [v221, v240) are affected.
13
14Patch backported from systemd-stable at f005e73d3723d62a39be661931fcb6347119b52b
15also includes a change from systemd master which removes a heap buffer overflow
16a6aadf4ae0bae185dc4c414d492a4a781c80ffe5.
17
18CVE: CVE-2018-16866
19Upstream-Status: Backport
20Signed-off-by: Marcus Cooper <marcusc@axis.com>
21---
22 src/journal/journald-syslog.c | 4 ++--
23 1 file changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/src/journal/journald-syslog.c b/src/journal/journald-syslog.c
26index 9dea116722..809b318c06 100644
27--- a/src/journal/journald-syslog.c
28+++ b/src/journal/journald-syslog.c
29@@ -194,7 +194,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
30 e = l;
31 l--;
32
33- if (p[l-1] == ']') {
34+ if (l > 0 && p[l-1] == ']') {
35 size_t k = l-1;
36
37 for (;;) {
38@@ -219,7 +219,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid)
39 if (t)
40 *identifier = t;
41
42- if (strchr(WHITESPACE, p[e]))
43+ if (p[e] != '\0' && strchr(WHITESPACE, p[e]))
44 e++;
45 *buf = p + e;
46 return e;
47--
482.11.0
49
diff --git a/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch b/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch
deleted file mode 100644
index 80170dac0f..0000000000
--- a/meta/recipes-core/systemd/systemd/CVE-2019-6454.patch
+++ /dev/null
@@ -1,210 +0,0 @@
1Description: sd-bus: enforce a size limit for dbus paths, and don't allocate
2 them on the stacka
3Forwarded: no
4
5Patch from: systemd_239-7ubuntu10.8
6
7For information see:
8https://usn.ubuntu.com/3891-1/
9https://git.launchpad.net/ubuntu/+source/systemd/commit/?id=f8e75d5634904c8e672658856508c3a02f349adb
10
11CVE: CVE-2019-6454
12Upstream-Status: Backport
13
14Signed-off-by: George McCollister <george.mccollister@gmail.com>
15
16--- a/src/libsystemd/sd-bus/bus-internal.c
17+++ b/src/libsystemd/sd-bus/bus-internal.c
18@@ -45,7 +45,7 @@
19 if (slash)
20 return false;
21
22- return true;
23+ return (q - p) <= BUS_PATH_SIZE_MAX;
24 }
25
26 char* object_path_startswith(const char *a, const char *b) {
27--- a/src/libsystemd/sd-bus/bus-internal.h
28+++ b/src/libsystemd/sd-bus/bus-internal.h
29@@ -333,6 +333,10 @@
30
31 #define BUS_MESSAGE_SIZE_MAX (128*1024*1024)
32 #define BUS_AUTH_SIZE_MAX (64*1024)
33+/* Note that the D-Bus specification states that bus paths shall have no size limit. We enforce here one
34+ * anyway, since truly unbounded strings are a security problem. The limit we pick is relatively large however,
35+ * to not clash unnecessarily with real-life applications. */
36+#define BUS_PATH_SIZE_MAX (64*1024)
37
38 #define BUS_CONTAINER_DEPTH 128
39
40--- a/src/libsystemd/sd-bus/bus-objects.c
41+++ b/src/libsystemd/sd-bus/bus-objects.c
42@@ -1134,7 +1134,8 @@
43 const char *path,
44 sd_bus_error *error) {
45
46- char *prefix;
47+ _cleanup_free_ char *prefix = NULL;
48+ size_t pl;
49 int r;
50
51 assert(bus);
52@@ -1150,7 +1151,12 @@
53 return 0;
54
55 /* Second, add fallback vtables registered for any of the prefixes */
56- prefix = alloca(strlen(path) + 1);
57+ pl = strlen(path);
58+ assert(pl <= BUS_PATH_SIZE_MAX);
59+ prefix = new(char, pl + 1);
60+ if (!prefix)
61+ return -ENOMEM;
62+
63 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
64 r = object_manager_serialize_path(bus, reply, prefix, path, true, error);
65 if (r < 0)
66@@ -1346,6 +1352,7 @@
67 }
68
69 int bus_process_object(sd_bus *bus, sd_bus_message *m) {
70+ _cleanup_free_ char *prefix = NULL;
71 int r;
72 size_t pl;
73 bool found_object = false;
74@@ -1370,9 +1377,12 @@
75 assert(m->member);
76
77 pl = strlen(m->path);
78- do {
79- char prefix[pl+1];
80+ assert(pl <= BUS_PATH_SIZE_MAX);
81+ prefix = new(char, pl + 1);
82+ if (!prefix)
83+ return -ENOMEM;
84
85+ do {
86 bus->nodes_modified = false;
87
88 r = object_find_and_run(bus, m, m->path, false, &found_object);
89@@ -1499,9 +1509,15 @@
90
91 n = hashmap_get(bus->nodes, path);
92 if (!n) {
93- char *prefix;
94+ _cleanup_free_ char *prefix = NULL;
95+ size_t pl;
96+
97+ pl = strlen(path);
98+ assert(pl <= BUS_PATH_SIZE_MAX);
99+ prefix = new(char, pl + 1);
100+ if (!prefix)
101+ return -ENOMEM;
102
103- prefix = alloca(strlen(path) + 1);
104 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
105 n = hashmap_get(bus->nodes, prefix);
106 if (n)
107@@ -2091,8 +2107,9 @@
108 char **names) {
109
110 BUS_DONT_DESTROY(bus);
111+ _cleanup_free_ char *prefix = NULL;
112 bool found_interface = false;
113- char *prefix;
114+ size_t pl;
115 int r;
116
117 assert_return(bus, -EINVAL);
118@@ -2111,6 +2128,12 @@
119 if (names && names[0] == NULL)
120 return 0;
121
122+ pl = strlen(path);
123+ assert(pl <= BUS_PATH_SIZE_MAX);
124+ prefix = new(char, pl + 1);
125+ if (!prefix)
126+ return -ENOMEM;
127+
128 do {
129 bus->nodes_modified = false;
130
131@@ -2120,7 +2143,6 @@
132 if (bus->nodes_modified)
133 continue;
134
135- prefix = alloca(strlen(path) + 1);
136 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
137 r = emit_properties_changed_on_interface(bus, prefix, path, interface, true, &found_interface, names);
138 if (r != 0)
139@@ -2252,7 +2274,8 @@
140
141 static int object_added_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
142 _cleanup_set_free_ Set *s = NULL;
143- char *prefix;
144+ _cleanup_free_ char *prefix = NULL;
145+ size_t pl;
146 int r;
147
148 assert(bus);
149@@ -2297,7 +2320,12 @@
150 if (bus->nodes_modified)
151 return 0;
152
153- prefix = alloca(strlen(path) + 1);
154+ pl = strlen(path);
155+ assert(pl <= BUS_PATH_SIZE_MAX);
156+ prefix = new(char, pl + 1);
157+ if (!prefix)
158+ return -ENOMEM;
159+
160 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
161 r = object_added_append_all_prefix(bus, m, s, prefix, path, true);
162 if (r < 0)
163@@ -2436,7 +2464,8 @@
164
165 static int object_removed_append_all(sd_bus *bus, sd_bus_message *m, const char *path) {
166 _cleanup_set_free_ Set *s = NULL;
167- char *prefix;
168+ _cleanup_free_ char *prefix = NULL;
169+ size_t pl;
170 int r;
171
172 assert(bus);
173@@ -2468,7 +2497,12 @@
174 if (bus->nodes_modified)
175 return 0;
176
177- prefix = alloca(strlen(path) + 1);
178+ pl = strlen(path);
179+ assert(pl <= BUS_PATH_SIZE_MAX);
180+ prefix = new(char, pl + 1);
181+ if (!prefix)
182+ return -ENOMEM;
183+
184 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
185 r = object_removed_append_all_prefix(bus, m, s, prefix, path, true);
186 if (r < 0)
187@@ -2618,7 +2652,8 @@
188 const char *path,
189 const char *interface) {
190
191- char *prefix;
192+ _cleanup_free_ char *prefix = NULL;
193+ size_t pl;
194 int r;
195
196 assert(bus);
197@@ -2632,7 +2667,12 @@
198 if (bus->nodes_modified)
199 return 0;
200
201- prefix = alloca(strlen(path) + 1);
202+ pl = strlen(path);
203+ assert(pl <= BUS_PATH_SIZE_MAX);
204+ prefix = new(char, pl + 1);
205+ if (!prefix)
206+ return -ENOMEM;
207+
208 OBJECT_PATH_FOREACH_PREFIX(prefix, path) {
209 r = interfaces_added_append_one_prefix(bus, m, prefix, path, interface, true);
210 if (r != 0)
diff --git a/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch b/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch
deleted file mode 100644
index 57311faa60..0000000000
--- a/meta/recipes-core/systemd/systemd/sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch
+++ /dev/null
@@ -1,61 +0,0 @@
1Description: sd-bus: if we receive an invalid dbus message, ignore and
2 proceeed
3 .
4 dbus-daemon might have a slightly different idea of what a valid msg is
5 than us (for example regarding valid msg and field sizes). Let's hence
6 try to proceed if we can and thus drop messages rather than fail the
7 connection if we fail to validate a message.
8 .
9 Hopefully the differences in what is considered valid are not visible
10 for real-life usecases, but are specific to exploit attempts only.
11Author: Lennart Poettering <lennart@poettering.net>
12Forwarded: other,https://github.com/systemd/systemd/pull/11708/
13
14Patch from: systemd_239-7ubuntu10.8
15
16For information see:
17https://usn.ubuntu.com/3891-1/
18https://git.launchpad.net/ubuntu/+source/systemd/commit/?id=f8e75d5634904c8e672658856508c3a02f349adb
19
20CVE: CVE-2019-6454
21Upstream-Status: Backport
22
23Signed-off-by: George McCollister <george.mccollister@gmail.com>
24
25diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
26index 30d6455b6f..441b4a816f 100644
27--- a/src/libsystemd/sd-bus/bus-socket.c
28+++ b/src/libsystemd/sd-bus/bus-socket.c
29@@ -1072,7 +1072,7 @@ static int bus_socket_read_message_need(sd_bus *bus, size_t *need) {
30 }
31
32 static int bus_socket_make_message(sd_bus *bus, size_t size) {
33- sd_bus_message *t;
34+ sd_bus_message *t = NULL;
35 void *b;
36 int r;
37
38@@ -1097,7 +1097,9 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
39 bus->fds, bus->n_fds,
40 NULL,
41 &t);
42- if (r < 0) {
43+ if (r == -EBADMSG)
44+ log_debug_errno(r, "Received invalid message from connection %s, dropping.", strna(bus->description));
45+ else if (r < 0) {
46 free(b);
47 return r;
48 }
49@@ -1108,7 +1110,8 @@ static int bus_socket_make_message(sd_bus *bus, size_t size) {
50 bus->fds = NULL;
51 bus->n_fds = 0;
52
53- bus->rqueue[bus->rqueue_size++] = t;
54+ if (t)
55+ bus->rqueue[bus->rqueue_size++] = t;
56
57 return 1;
58 }
59--
602.17.1
61
diff --git a/meta/recipes-core/systemd/systemd_239.bb b/meta/recipes-core/systemd/systemd_241.bb
index 7af297245a..44a132a4a0 100644
--- a/meta/recipes-core/systemd/systemd_239.bb
+++ b/meta/recipes-core/systemd/systemd_241.bb
@@ -21,60 +21,38 @@ SRC_URI += "file://touchscreen.rules \
21 file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ 21 file://0002-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \
22 file://0003-implment-systemd-sysv-install-for-OE.patch \ 22 file://0003-implment-systemd-sysv-install-for-OE.patch \
23 file://0004-rules-whitelist-hd-devices.patch \ 23 file://0004-rules-whitelist-hd-devices.patch \
24 file://0005-Make-root-s-home-directory-configurable.patch \ 24 file://0005-rules-watch-metadata-changes-in-ide-devices.patch \
25 file://0006-remove-nobody-user-group-checking.patch \
26 file://0007-rules-watch-metadata-changes-in-ide-devices.patch \
27 file://0008-Do-not-enable-nss-tests-if-nss-systemd-is-not-enable.patch \
28 file://0009-nss-mymachines-Build-conditionally-when-ENABLE_MYHOS.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 \
31 file://0022-build-sys-Detect-whether-struct-statx-is-defined-in-.patch \
32 file://0023-resolvconf-fixes-for-the-compatibility-interface.patch \
33 file://0001-core-when-deserializing-state-always-use-read_line-L.patch \
34 file://0001-chown-recursive-let-s-rework-the-recursive-logic-to-.patch \
35 file://0001-dhcp6-make-sure-we-have-enough-space-for-the-DHCP6-o.patch \
36 file://0001-Revert-sysctl.d-request-ECN-on-both-in-and-outgoing-.patch \
37 file://0001-timesync-changes-type-of-drift_freq-to-int64_t.patch \
38 file://0001-sysctl-Don-t-pass-null-directive-argument-to-s.patch \
39 file://0002-core-Fix-use-after-free-case-in-load_from_path.patch \
40 file://0001-meson-rename-Ddebug-to-Ddebug-extra.patch \
41 file://0024-journald-do-not-store-the-iovec-entry-for-process-co.patch \
42 file://0025-journald-set-a-limit-on-the-number-of-fields.patch \
43 file://0026-journal-fix-out-of-bounds-read-CVE-2018-16866.patch \
44 file://CVE-2019-6454.patch \
45 file://sd-bus-if-we-receive-an-invalid-dbus-message-ignore-.patch \
46 " 25 "
47 26
48# patches made for musl are only applied on TCLIBC is musl 27# patches needed by musl
49SRC_URI += "${SRC_URI_MUSL}" 28SRC_URI += "${SRC_URI_MUSL}"
50SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \ 29SRC_URI_MUSL = "file://0001-Use-getenv-when-secure-versions-are-not-available.patch \
51 file://0002-don-t-use-glibc-specific-qsort_r.patch \ 30 file://0002-don-t-use-glibc-specific-qsort_r.patch \
52 file://0003-comparison_fn_t-is-glibc-specific-use-raw-signature-.patch \ 31 file://0003-missing_type.h-add-__compare_fn_t-and-comparison_fn_.patch \
53 file://0004-add-fallback-parse_printf_format-implementation.patch \ 32 file://0004-add-fallback-parse_printf_format-implementation.patch \
54 file://0005-basic-user-util-properly-protect-use-of-gshadow.patch \ 33 file://0005-src-basic-missing.h-check-for-missing-strndupa.patch \
55 file://0006-src-basic-missing.h-check-for-missing-strndupa.patch \ 34 file://0006-Include-netinet-if_ether.h.patch \
56 file://0007-Include-netinet-if_ether.h.patch \ 35 file://0007-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not.patch \
57 file://0008-don-t-fail-if-GLOB_BRACE-and-GLOB_ALTDIRFUNC-is-not-.patch \ 36 file://0008-add-missing-FTW_-macros-for-musl.patch \
58 file://0009-add-missing-FTW_-macros-for-musl.patch \ 37 file://0009-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \
59 file://0010-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ 38 file://0010-fix-missing-of-__register_atfork-for-non-glibc-build.patch \
60 file://0011-src-basic-missing.h-check-for-missing-__compar_fn_t-.patch \ 39 file://0011-Use-uintmax_t-for-handling-rlim_t.patch \
61 file://0012-fix-missing-of-__register_atfork-for-non-glibc-build.patch \ 40 file://0012-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \
62 file://0013-Use-uintmax_t-for-handling-rlim_t.patch \ 41 file://0013-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \
63 file://0014-fix-missing-ULONG_LONG_MAX-definition-in-case-of-mus.patch \ 42 file://0014-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \
64 file://0015-test-hexdecoct.c-Include-missing.h-for-strndupa.patch \ 43 file://0015-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \
65 file://0016-test-sizeof.c-Disable-tests-for-missing-typedefs-in-.patch \ 44 file://0016-Define-glibc-compatible-basename-for-non-glibc-syste.patch \
66 file://0017-don-t-pass-AT_SYMLINK_NOFOLLOW-flag-to-faccessat.patch \ 45 file://0017-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \
67 file://0018-Define-glibc-compatible-basename-for-non-glibc-syste.patch \ 46 file://0018-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \
68 file://0019-Do-not-disable-buffering-when-writing-to-oom_score_a.patch \ 47 file://0019-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \
69 file://0020-distinguish-XSI-compliant-strerror_r-from-GNU-specif.patch \ 48 file://0020-missing_type.h-add-__compar_d_fn_t-definition.patch \
70 file://0021-Hide-__start_BUS_ERROR_MAP-and-__stop_BUS_ERROR_MAP.patch \ 49 file://0021-avoid-redefinition-of-prctl_mm_map-structure.patch \
71 file://0022-Use-if-instead-of-ifdef-for-ENABLE_GSHADOW.patch \ 50 file://0022-include-sys-wait.h-to-avoid-compile-failure.patch \
51 file://0023-socket-util.h-include-string.h.patch \
52 file://0024-test-json.c-define-M_PIl.patch \
53 file://0001-do-not-disable-buffer-in-writing-files.patch \
72 " 54 "
73 55
74# Workaround undefined reference to `__stack_chk_fail_local' on qemux86 and qemuppc for musl
75SRC_URI_append_libc-musl_qemux86 = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
76SRC_URI_append_libc-musl_qemuppc = " file://0001-Remove-fstack-protector-flags-to-workaround-musl-bui.patch"
77
78PAM_PLUGINS = " \ 56PAM_PLUGINS = " \
79 pam-plugin-unix \ 57 pam-plugin-unix \
80 pam-plugin-loginuid \ 58 pam-plugin-loginuid \
@@ -100,6 +78,8 @@ PACKAGECONFIG ??= " \
100 myhostname \ 78 myhostname \
101 networkd \ 79 networkd \
102 nss \ 80 nss \
81 nss-mymachines \
82 nss-resolve \
103 quotacheck \ 83 quotacheck \
104 randomseed \ 84 randomseed \
105 resolved \ 85 resolved \
@@ -117,6 +97,8 @@ PACKAGECONFIG_remove_libc-musl = " \
117 localed \ 97 localed \
118 myhostname \ 98 myhostname \
119 nss \ 99 nss \
100 nss-mymachines \
101 nss-resolve \
120 resolved \ 102 resolved \
121 selinux \ 103 selinux \
122 smack \ 104 smack \
@@ -161,9 +143,11 @@ PACKAGECONFIG[lz4] = "-Dlz4=true,-Dlz4=false,lz4"
161PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false" 143PACKAGECONFIG[machined] = "-Dmachined=true,-Dmachined=false"
162PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" 144PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native"
163PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd" 145PACKAGECONFIG[microhttpd] = "-Dmicrohttpd=true,-Dmicrohttpd=false,libmicrohttpd"
164PACKAGECONFIG[myhostname] = "-Dmyhostname=true,-Dmyhostname=false" 146PACKAGECONFIG[myhostname] = "-Dnss-myhostname=true,-Dnss-myhostname=false"
165PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false" 147PACKAGECONFIG[networkd] = "-Dnetworkd=true,-Dnetworkd=false"
166PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false" 148PACKAGECONFIG[nss] = "-Dnss-systemd=true,-Dnss-systemd=false"
149PACKAGECONFIG[nss-mymachines] = "-Dnss-mymachines=true,-Dnss-mymachines=false"
150PACKAGECONFIG[nss-resolve] = "-Dnss-resolve=true,-Dnss-resolve=false"
167PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}" 151PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam,${PAM_PLUGINS}"
168PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false" 152PACKAGECONFIG[polkit] = "-Dpolkit=true,-Dpolkit=false"
169PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false" 153PACKAGECONFIG[portabled] = "-Dportabled=true,-Dportabled=false"
@@ -203,7 +187,6 @@ EXTRA_OEMESON += "-Dlink-udev-shared=false"
203 187
204EXTRA_OEMESON += "-Dnobody-user=nobody \ 188EXTRA_OEMESON += "-Dnobody-user=nobody \
205 -Dnobody-group=nobody \ 189 -Dnobody-group=nobody \
206 -Droothomedir=${ROOT_HOME} \
207 -Drootlibdir=${rootlibdir} \ 190 -Drootlibdir=${rootlibdir} \
208 -Drootprefix=${rootprefix} \ 191 -Drootprefix=${rootprefix} \
209 -Dsysvrcnd-path=${sysconfdir} \ 192 -Dsysvrcnd-path=${sysconfdir} \