SHA256
1
0
forked from pool/systemd

- Move more packaging fixups in the fixlet script.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1391
This commit is contained in:
Franck Bui 2023-05-09 14:28:15 +00:00 committed by Git OBS Bridge
parent 7491f913dd
commit 4f8a2eddf8
3 changed files with 61 additions and 36 deletions

View File

@ -162,6 +162,10 @@ migrate_sysconfig_i18n() {
migrate_keyboard; rv+=$?
migrate_language; rv+=$?
if [ $rv -gt 0 ]; then
echo >&2 "Failed to migrate i18n settings from /etc/sysconfig, ignoring."
fi
return $rv
}
@ -207,13 +211,58 @@ fix_pre_210() {
done
}
r=0
fix_pre_210 || {
r=1
}
migrate_sysconfig_i18n || {
echo >&2 "Failed to migrate i18n settings from /etc/sysconfig, continuing..."
r=1
#
# /etc/machine-id might have been created writeable incorrectly (boo#1092269).
#
# Note: run at each package update.
#
fix_machine_id_perms() {
if [ "$(stat -c%a /etc/machine-id)" != 444 ]; then
echo "Incorrect file mode bits for /etc/machine-id which should be 0444, fixing..."
chmod 444 /etc/machine-id
fi
}
#
# v228 wrongly set world writable suid root permissions on timestamp files used
# by permanent timers. Fix the timestamps that might have been created by the
# affected versions of systemd (bsc#1020601).
#
# Note: run at each package update.
#
fix_bsc_1020601() {
for stamp in $(ls /var/lib/systemd/timers/stamp-*.timer 2>/dev/null); do
chmod 0644 $stamp
done
# Same for user lingering created by logind.
for username in $(ls /var/lib/systemd/linger/* 2>/dev/null); do
chmod 0644 $username
done
}
#
# Due to the fact that DynamicUser= was turned ON during v235 and then switched
# back to off in v240, /var/lib/systemd/timesync might be a symlink pointing to
# /var/lib/private/systemd/timesync, which is inaccessible for systemd-timesync
# user as /var/lib/private is 0700 root:root, see
# https://github.com/systemd/systemd/issues/11329 for details.
#
# Note: only TW might be affected by this bug.
# Note: run at each package update.
#
fix_issue_11329() {
if [ -L %{_localstatedir}/lib/systemd/timesync ]; then
rm %{_localstatedir}/lib/systemd/timesync
mv %{_localstatedir}/lib/private/systemd/timesync %{_localstatedir}/lib/systemd/timesync
fi
}
r=0
fix_machine_id_perms || r=1
fix_pre_210 || r=1
migrate_sysconfig_i18n || r=1
fix_bsc_1020601 || r=1
fix_issue_11329 || r=1
exit $r

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Tue May 9 14:25:04 UTC 2023 - Franck Bui <fbui@suse.com>
- Move more packaging fixups in the fixlet script.
-------------------------------------------------------------------
Tue May 9 13:59:56 UTC 2023 - Franck Bui <fbui@suse.com>

View File

@ -986,12 +986,6 @@ if [ $1 -eq 1 ]; then
chmod 444 %{_sysconfdir}/machine-id
fi
# /etc/machine-id might have been created writeable incorrectly (boo#1092269).
if [ "$(stat -c%a %{_sysconfdir}/machine-id)" != 444 ]; then
echo "Incorrect file mode bits for /etc/machine-id which should be 0444, fixing..."
chmod 444 %{_sysconfdir}/machine-id
fi
%if %{without bootstrap}
pam-config --add --systemd || :
# Run ldconfig for nss-systemd and nss-myhostname NSS modules.
@ -1037,29 +1031,6 @@ if [ $1 -gt 1 ]; then
%systemd_post systemd-journald-audit.socket
fi
# v228 wrongly set world writable suid root permissions on timestamp files used
# by permanent timers. Fix the timestamps that might have been created by the
# affected versions of systemd (bsc#1020601).
for stamp in $(ls /var/lib/systemd/timers/stamp-*.timer 2>/dev/null); do
chmod 0644 $stamp
done
# Same for user lingering created by logind.
for username in $(ls /var/lib/systemd/linger/* 2>/dev/null); do
chmod 0644 $username
done
# Due to the fact that DynamicUser= was turned ON during v235 and then switched
# back to off in v240, /var/lib/systemd/timesync might be a symlink pointing to
# /var/lib/private/systemd/timesync, which is inaccessible for systemd-timesync
# user as /var/lib/private is 0700 root:root, see
# https://github.com/systemd/systemd/issues/11329 for details. Note: only TW
# users might be affected by this bug.
if [ -L %{_localstatedir}/lib/systemd/timesync ]; then
rm %{_localstatedir}/lib/systemd/timesync
mv %{_localstatedir}/lib/private/systemd/timesync %{_localstatedir}/lib/systemd/timesync
fi
# Run the hacks/fixups to clean up old garbages left by (very) old versions of
# systemd.
%{_systemd_util_dir}/rpm/fixlet-systemd-post.sh $1 || :