!207 [sync] PR-206: 1.不生成systemd-coredump子包 2、同步部分补丁解决issue
From: @openeuler-sync-bot Reviewed-by: @overweight Signed-off-by: @overweight
This commit is contained in:
commit
b3d6e79248
@ -16,8 +16,8 @@ index 92815b1dbaea..1c8159a23550 100644
|
||||
if (!separate_argv0) {
|
||||
char *w = NULL;
|
||||
|
||||
- if (!GREEDY_REALLOC(n, nbufsize, nlen + 2))
|
||||
+ if (!GREEDY_REALLOC0(n, nbufsize, nlen + 2))
|
||||
- if (!GREEDY_REALLOC(n, nlen + 2))
|
||||
+ if (!GREEDY_REALLOC0(n, nlen + 2))
|
||||
return log_oom();
|
||||
|
||||
w = strdup(path);
|
||||
@ -25,8 +25,8 @@ index 92815b1dbaea..1c8159a23550 100644
|
||||
p += 2;
|
||||
p += strspn(p, WHITESPACE);
|
||||
|
||||
- if (!GREEDY_REALLOC(n, nbufsize, nlen + 2))
|
||||
+ if (!GREEDY_REALLOC0(n, nbufsize, nlen + 2))
|
||||
- if (!GREEDY_REALLOC(n, nlen + 2))
|
||||
+ if (!GREEDY_REALLOC0(n, nlen + 2))
|
||||
return log_oom();
|
||||
|
||||
w = strdup(";");
|
||||
|
||||
@ -0,0 +1,26 @@
|
||||
From 193105f2d0408e2d96265935174b3cf0f100ef2e Mon Sep 17 00:00:00 2001
|
||||
From: jiangchuangang <jiangchuangang@huawei.com>
|
||||
Date: Mon, 29 Nov 2021 22:30:37 +0800
|
||||
Subject: [PATCH] fix ConditionDirectoryNotEmpty when it comes to a
|
||||
Non-directory file
|
||||
|
||||
---
|
||||
src/shared/condition.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/condition.c b/src/shared/condition.c
|
||||
index 6e769e9d59..a86f2b9ffb 100644
|
||||
--- a/src/shared/condition.c
|
||||
+++ b/src/shared/condition.c
|
||||
@@ -931,7 +931,7 @@ static int condition_test_directory_not_empty(Condition *c, char **env) {
|
||||
assert(c->type == CONDITION_DIRECTORY_NOT_EMPTY);
|
||||
|
||||
r = dir_is_empty(c->parameter);
|
||||
- return r <= 0 && r != -ENOENT;
|
||||
+ return r <= 0 && !IN_SET(r, -ENOENT, -ENOTDIR);
|
||||
}
|
||||
|
||||
static int condition_test_file_not_empty(Condition *c, char **env) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
From 7c4c9948d02ceda903ed4e4deea0d0084612625a Mon Sep 17 00:00:00 2001
|
||||
From: jiangchuangang <jiangchuangang@huawei.com>
|
||||
Date: Tue, 30 Nov 2021 15:25:27 +0800
|
||||
Subject: [PATCH] fix ConditionPathIsReadWrite when path does not exist.
|
||||
|
||||
---
|
||||
src/shared/condition.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/shared/condition.c b/src/shared/condition.c
|
||||
index a86f2b9ffb..dae75a5bf5 100644
|
||||
--- a/src/shared/condition.c
|
||||
+++ b/src/shared/condition.c
|
||||
@@ -894,11 +894,15 @@ static int condition_test_path_is_mount_point(Condition *c, char **env) {
|
||||
}
|
||||
|
||||
static int condition_test_path_is_read_write(Condition *c, char **env) {
|
||||
+ int r;
|
||||
+
|
||||
assert(c);
|
||||
assert(c->parameter);
|
||||
assert(c->type == CONDITION_PATH_IS_READ_WRITE);
|
||||
|
||||
- return path_is_read_only_fs(c->parameter) <= 0;
|
||||
+ r = path_is_read_only_fs(c->parameter);
|
||||
+
|
||||
+ return r <= 0 && r != -ENOENT;
|
||||
}
|
||||
|
||||
static int condition_test_cpufeature(Condition *c, char **env) {
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -0,0 +1,25 @@
|
||||
From 5896a9ebdbe4d38c01390d0a5e82f9fcb4971059 Mon Sep 17 00:00:00 2001
|
||||
From: yangmingtai <961612727@qq.com>
|
||||
Date: Mon, 6 Dec 2021 17:06:13 +0800
|
||||
Subject: [PATCH] fix DirectoryNotEmpty when it comes to a Non-directory file
|
||||
|
||||
---
|
||||
src/core/path.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/core/path.c b/src/core/path.c
|
||||
index 29ec66fd4d..bcd922901b 100644
|
||||
--- a/src/core/path.c
|
||||
+++ b/src/core/path.c
|
||||
@@ -215,7 +215,7 @@ static bool path_spec_check_good(PathSpec *s, bool initial, bool from_trigger_no
|
||||
int k;
|
||||
|
||||
k = dir_is_empty(s->path);
|
||||
- good = !(k == -ENOENT || k > 0);
|
||||
+ good = !(IN_SET(k, -ENOENT, -ENOTDIR) || k > 0);
|
||||
break;
|
||||
}
|
||||
|
||||
--
|
||||
2.27.0
|
||||
|
||||
55
systemd.spec
55
systemd.spec
@ -20,7 +20,7 @@
|
||||
Name: systemd
|
||||
Url: https://www.freedesktop.org/wiki/Software/systemd
|
||||
Version: 249
|
||||
Release: 2
|
||||
Release: 4
|
||||
License: MIT and LGPLv2+ and GPLv2+
|
||||
Summary: System and Service Manager
|
||||
|
||||
@ -64,6 +64,14 @@ Patch0015: 0015-systemd-change-time-log-level.patch
|
||||
Patch0016: 0016-fix-capsh-drop-but-ping-success.patch
|
||||
Patch0017: 0017-resolved-create-etc-resolv.conf-symlink-at-runtime.patch
|
||||
|
||||
#backport
|
||||
Patch6000: backport-core-fix-free-undefined-pointer-when-strdup-failed-i.patch
|
||||
Patch6001: backport-fix-ConditionDirectoryNotEmpty-when-it-comes-to-a-No.patch
|
||||
Patch6002: backport-fix-ConditionPathIsReadWrite-when-path-does-not-exis.patch
|
||||
Patch6003: backport-fix-DirectoryNotEmpty-when-it-comes-to-a-Non-directo.patch
|
||||
|
||||
#openEuler
|
||||
|
||||
BuildRequires: gcc, gcc-c++
|
||||
BuildRequires: libcap-devel, libmount-devel, pam-devel, libselinux-devel
|
||||
BuildRequires: audit-libs-devel, cryptsetup-devel, dbus-devel, libacl-devel
|
||||
@ -286,18 +294,6 @@ Requires: %{name} = %{version}-%{release}
|
||||
%description pam
|
||||
Systemd PAM module registers the session with systemd-logind.
|
||||
|
||||
%package coredump
|
||||
Summary: Systemd tools for coredump management
|
||||
License: LGPLv2+
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
%systemd_requires
|
||||
Provides: systemd:%{_bindir}/coredumpctl
|
||||
|
||||
%description coredump
|
||||
Systemd tools to store and manage coredumps.
|
||||
|
||||
This package contains systemd-coredump, coredumpctl.
|
||||
|
||||
%package portable
|
||||
Summary: Systemd tools for portable services
|
||||
License: LGPLv2+
|
||||
@ -650,7 +646,6 @@ getent group kvm &>/dev/null || groupadd -r -g 36 kvm &>/dev/null || :
|
||||
getent group render &>/dev/null || groupadd -r render &>/dev/null || :
|
||||
getent group systemd-journal &>/dev/null || groupadd -r -g 190 systemd-journal 2>&1 || :
|
||||
|
||||
%pre coredump
|
||||
getent group systemd-coredump &>/dev/null || groupadd -r systemd-coredump 2>&1 || :
|
||||
getent passwd systemd-coredump &>/dev/null || useradd -r -l -g systemd-coredump -d / -s /sbin/nologin -c "systemd Core Dumper" systemd-coredump &>/dev/null || :
|
||||
|
||||
@ -885,6 +880,7 @@ fi
|
||||
%ghost %attr(0700,root,root) %dir /var/lib/private
|
||||
%dir /var/lib/systemd
|
||||
%dir /var/lib/systemd/catalog
|
||||
%ghost %dir /var/lib/systemd/coredump
|
||||
%ghost %dir /var/lib/systemd/linger
|
||||
%ghost /var/lib/systemd/catalog/database
|
||||
%ghost %dir /var/lib/private/systemd
|
||||
@ -989,6 +985,7 @@ fi
|
||||
/usr/bin/systemd-sysusers
|
||||
/usr/bin/systemd-tty-ask-password-agent
|
||||
/usr/bin/busctl
|
||||
/usr/bin/coredumpctl
|
||||
%dir /usr/lib/environment.d
|
||||
%dir /usr/lib/binfmt.d
|
||||
%dir /usr/lib/tmpfiles.d
|
||||
@ -1036,6 +1033,7 @@ fi
|
||||
%dir %{_systemddir}/user-generators
|
||||
%{_systemddir}/systemd
|
||||
%dir %{_systemddir}/user-preset
|
||||
%{_systemddir}/systemd-coredump
|
||||
%{_systemddir}/systemd-veritysetup
|
||||
%{_systemddir}/systemd-network-generator
|
||||
%{_systemddir}/systemd-binfmt
|
||||
@ -1044,6 +1042,8 @@ fi
|
||||
%{_unitdir}/systemd-binfmt.service
|
||||
%{_unitdir}/systemd-machine-id-commit.service
|
||||
%dir %{_unitdir}/basic.target.wants
|
||||
%{_unitdir}/systemd-coredump.socket
|
||||
%{_unitdir}/systemd-coredump@.service
|
||||
%{_unitdir}/ctrl-alt-del.target
|
||||
%{_unitdir}/systemd-tmpfiles-setup.service
|
||||
%{_unitdir}/rpcbind.target
|
||||
@ -1216,6 +1216,7 @@ fi
|
||||
%{_unitdir}/multi-user.target.wants/systemd-ask-password-wall.path
|
||||
%{_unitdir}/multi-user.target.wants/systemd-update-utmp-runlevel.service
|
||||
%{_unitdir}/systemd-hostnamed.service.d/disable-privatedevices.conf
|
||||
%{_unitdir}/sockets.target.wants/systemd-coredump.socket
|
||||
%{_unitdir}/sockets.target.wants/systemd-journald-dev-log.socket
|
||||
%{_unitdir}/sockets.target.wants/systemd-journald.socket
|
||||
%{_unitdir}/sockets.target.wants/systemd-initctl.socket
|
||||
@ -1276,6 +1277,7 @@ fi
|
||||
%{_systemddir}/user/xdg-desktop-autostart.target
|
||||
/usr/lib/sysctl.d/50-default.conf
|
||||
/usr/lib/sysctl.d/50-pid-max.conf
|
||||
/usr/lib/sysctl.d/50-coredump.conf
|
||||
/usr/lib/tmpfiles.d/systemd-tmp.conf
|
||||
/usr/lib/tmpfiles.d/systemd-nologin.conf
|
||||
/usr/lib/tmpfiles.d/systemd.conf
|
||||
@ -1305,6 +1307,7 @@ fi
|
||||
%dir /etc/systemd/user
|
||||
%config(noreplace) /etc/systemd/logind.conf
|
||||
%config(noreplace) /etc/systemd/journald.conf
|
||||
%config(noreplace) /etc/systemd/coredump.conf
|
||||
%dir /etc/systemd/system
|
||||
%config(noreplace) /etc/systemd/system.conf
|
||||
%ghost %config(noreplace) /etc/X11/xorg.conf.d/00-keyboard.conf
|
||||
@ -1677,16 +1680,6 @@ fi
|
||||
%files pam
|
||||
%{_libdir}/security/pam_systemd.so
|
||||
|
||||
%files coredump
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/coredumpctl
|
||||
%{_prefix}/lib/systemd/systemd-coredump
|
||||
%{_unitdir}/systemd-coredump*
|
||||
%{_unitdir}/sockets.target.wants/systemd-coredump.socket
|
||||
%{_sysctldir}/50-coredump.conf
|
||||
%config(noreplace) %{_sysconfdir}/systemd/coredump.conf
|
||||
%dir %{_localstatedir}/lib/systemd/coredump
|
||||
|
||||
%files portable
|
||||
%defattr(-,root,root)
|
||||
%{_bindir}/portablectl
|
||||
@ -1712,8 +1705,14 @@ fi
|
||||
%{_unitdir}/systemd-userdbd.socket
|
||||
|
||||
%changelog
|
||||
+* Tue Dec 27 2021 yangmingtai <yangmingtai@huawei.com> - 249-2
|
||||
+- delete useless Provides and Obsoletes
|
||||
* Tue Feb 8 2021 yangmingtai <yangmingtai@huawei.com> - 249-4
|
||||
- fix ConditionDirectoryNotEmpty,ConditionPathIsReadWrite and DirectoryNotEmpty
|
||||
|
||||
* Tue Feb 8 2021 yangmingtai <yangmingtai@huawei.com> - 249-3
|
||||
- do not make systemd-cpredump sub packages
|
||||
|
||||
* Tue Dec 27 2021 yangmingtai <yangmingtai@huawei.com> - 249-2
|
||||
- delete useless Provides and Obsoletes
|
||||
|
||||
* Wed Dec 8 2021 yangmingtai <yangmingtai@huawei.com> - 249-1
|
||||
- systemd update to v249
|
||||
@ -1736,10 +1735,10 @@ fi
|
||||
* Mon Aug 16 2021 yangmingtai <yangmingtai@huawei.com> - 248-8
|
||||
- udev: exec daemon-reload after installation
|
||||
|
||||
* Thu Jun 03 2021 yangmingtai <yangmingtai@huawei.com> - 248-7
|
||||
* Fri Jul 22 2021 yangmingtai <yangmingtai@huawei.com> - 248-7
|
||||
- fix CVE-2021-33910
|
||||
|
||||
* Thu Jul 22 2021 shenyangyang <shenyangyang4@huawei.com> - 248-6
|
||||
* Thu Jun 03 2021 shenyangyang <shenyangyang4@huawei.com> - 248-6
|
||||
- change requires to openssl-libs as post scripts systemctl requires libssl.so.1.1
|
||||
|
||||
* Mon May 31 2021 hexiaowen<hexiaowen@huawei.com> - 248-5
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user