systemd: sysusers fsync patch (#3547)

Patch to fix fsync issue for /etc/passwd in systemd-sysusers
https://github.com/systemd/systemd/pull/24324
This commit is contained in:
Avram Lubkin 2022-08-24 14:38:46 -04:00 committed by GitHub
parent fdc6619ad3
commit 760886bda1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 37 additions and 12 deletions

View File

@ -0,0 +1,12 @@
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 07a65a2ebc..90adca7d95 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -509,7 +509,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char
break;
}
- r = fflush_and_check(passwd);
+ r = fflush_sync_and_check(passwd);
if (r < 0)
return log_debug_errno(r, "Failed to flush %s: %m", passwd_tmp);

View File

@ -1,5 +1,6 @@
{
"Signatures": {
"add-fsync-sysusers-passwd.patch": "c86c20c9bf0d79faeb99c454e8fb79df1b81d9243f45a209f7c8f58924ec7dba",
"50-security-hardening.conf": "c9fc6624a3178cc0980ec3495ac2d5f02a8a1f3a4cdadb8770628d7394b92e2c",
"99-dhcp-en.network": "158c0003826cef9d780799c6edb2814800d4518f85f884710550f4c46d14be67",
"systemd-250.3.tar.gz": "87b0eee7b6e5aaab2ab56d158f9536daa6bfd5de011f2a5fc6ccdd81ee1e7a24",

View File

@ -1,7 +1,7 @@
Summary: Bootstrap version of systemd. Workaround for systemd circular dependency.
Name: systemd-bootstrap
Version: 250.3
Release: 4%{?dist}
Release: 5%{?dist}
License: LGPLv2+ AND GPLv2+ AND MIT
Vendor: Microsoft Corporation
Distribution: Mariner
@ -12,6 +12,9 @@ Source1: 50-security-hardening.conf
Source2: systemd.cfg
Source3: 99-dhcp-en.network
Patch0: fix-journald-audit-logging.patch
# Can be removed once we update systemd to a version containing the following commit:
# https://github.com/systemd/systemd/commit/19193b489841a7bcccda7122ac0849cf6efe59fd
Patch1: add-fsync-sysusers-passwd.patch
BuildRequires: docbook-dtd-xml
BuildRequires: docbook-style-xsl
BuildRequires: gettext
@ -228,6 +231,9 @@ systemctl preset-all
%{_datadir}/pkgconfig/udev.pc
%changelog
* Tue Aug 16 2022 Avram Lubkin <avramlubkin@microsoft.com> - 250.3-5
- Add patch to fsync passwd file (systemd #24324)
* Wed May 04 2022 Jon Slobodzian <joslobo@microsoft.com> - 250.3-4
- Change build mode from "development" (default) to "release"
@ -262,7 +268,7 @@ systemctl preset-all
* Wed Jul 28 2021 Henry Li <lihl@microsoft.com> - 239-40
- Enable building systemd-sysusers
- Ship systemd-sysusers and related conf files from systemd package
- Ship systemd-sysusers and related conf files from systemd package
* Fri May 14 2021 Thomas Crain <thcrain@microsoft.com> - 239-39
- Merge the following releases from 1.0 to dev branch

View File

@ -1,7 +1,7 @@
Summary: Systemd-250
Name: systemd
Version: 250.3
Release: 6%{?dist}
Release: 7%{?dist}
License: LGPLv2+ AND GPLv2+ AND MIT
Vendor: Microsoft Corporation
Distribution: Mariner
@ -12,6 +12,9 @@ Source1: 50-security-hardening.conf
Source2: systemd.cfg
Source3: 99-dhcp-en.network
Patch0: fix-journald-audit-logging.patch
# Can be removed once we update systemd to a version containing the following commit:
# https://github.com/systemd/systemd/commit/19193b489841a7bcccda7122ac0849cf6efe59fd
Patch1: add-fsync-sysusers-passwd.patch
BuildRequires: cryptsetup-devel
BuildRequires: docbook-dtd-xml
BuildRequires: docbook-style-xsl
@ -258,6 +261,9 @@ systemctl preset-all
%files lang -f %{name}.lang
%changelog
* Tue Aug 16 2022 Avram Lubkin <avramlubkin@microsoft.com> - 250.3-7
- Add patch to fsync passwd file (systemd #24324)
* Wed May 04 2022 Jon Slobodzian <joslobo@microsoft.com> - 250.3-6
- Change build mode from "development" (default) to "release"
@ -300,7 +306,7 @@ systemctl preset-all
* Wed Jul 28 2021 Henry Li <lihl@microsoft.com> - 239-40
- Enable building systemd-sysusers
- Ship systemd-sysusers and related conf files from systemd package
- Ship systemd-sysusers and related conf files from systemd package
* Fri May 14 2021 Thomas Crain <thcrain@microsoft.com> - 239-39
- Merge the following releases from 1.0 to dev branch

View File

@ -543,10 +543,10 @@ sqlite-devel-3.39.2-1.cm2.aarch64.rpm
sqlite-libs-3.39.2-1.cm2.aarch64.rpm
swig-4.0.2-3.cm2.aarch64.rpm
swig-debuginfo-4.0.2-3.cm2.aarch64.rpm
systemd-bootstrap-250.3-4.cm2.aarch64.rpm
systemd-bootstrap-debuginfo-250.3-4.cm2.aarch64.rpm
systemd-bootstrap-devel-250.3-4.cm2.aarch64.rpm
systemd-bootstrap-rpm-macros-250.3-4.cm2.noarch.rpm
systemd-bootstrap-250.3-5.cm2.aarch64.rpm
systemd-bootstrap-debuginfo-250.3-5.cm2.aarch64.rpm
systemd-bootstrap-devel-250.3-5.cm2.aarch64.rpm
systemd-bootstrap-rpm-macros-250.3-5.cm2.noarch.rpm
tar-1.34-1.cm2.aarch64.rpm
tar-debuginfo-1.34-1.cm2.aarch64.rpm
tdnf-3.2.2-4.cm2.aarch64.rpm

View File

@ -543,10 +543,10 @@ sqlite-devel-3.39.2-1.cm2.x86_64.rpm
sqlite-libs-3.39.2-1.cm2.x86_64.rpm
swig-4.0.2-3.cm2.x86_64.rpm
swig-debuginfo-4.0.2-3.cm2.x86_64.rpm
systemd-bootstrap-250.3-4.cm2.x86_64.rpm
systemd-bootstrap-debuginfo-250.3-4.cm2.x86_64.rpm
systemd-bootstrap-devel-250.3-4.cm2.x86_64.rpm
systemd-bootstrap-rpm-macros-250.3-4.cm2.noarch.rpm
systemd-bootstrap-250.3-5.cm2.x86_64.rpm
systemd-bootstrap-debuginfo-250.3-5.cm2.x86_64.rpm
systemd-bootstrap-devel-250.3-5.cm2.x86_64.rpm
systemd-bootstrap-rpm-macros-250.3-5.cm2.noarch.rpm
tar-1.34-1.cm2.x86_64.rpm
tar-debuginfo-1.34-1.cm2.x86_64.rpm
tdnf-3.2.2-4.cm2.x86_64.rpm