Fix the coredump which may occur during upgrading of rpm

This commit is contained in:
renxichen 2023-09-05 19:20:09 +08:00
parent 9bc90ed71e
commit f340b294aa

View File

@ -1,6 +1,6 @@
Name: rpm Name: rpm
Version: 4.18.1 Version: 4.18.1
Release: 5 Release: 6
Summary: RPM Package Manager Summary: RPM Package Manager
License: GPLv2+ License: GPLv2+
URL: http://www.rpm.org/ URL: http://www.rpm.org/
@ -158,6 +158,19 @@ done;
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily
install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm install -m 755 scripts/rpm.daily ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
# During the upgrade of the major rpm version, the dynamic library may not be compatible.
# Therefore, ensure that no other rpm command is executed during the upgrade. A judgment
# is added to the RPM script of the scheduled task. If the dynamic library is not the
# dynamic library of the current version, exits directly.
pushd ${RPM_BUILD_ROOT}%{_libdir}
export SONAME=`ls librpm.so.*.*.*`
popd
sed -i "/bin\/sh/a \
if [ ! -e %{_libdir}\/${SONAME} ]; then\n\
exit 0\n\
fi" ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm
cp ${RPM_BUILD_ROOT}%{_sysconfdir}/cron.daily/rpm ${RPM_BUILD_ROOT}%{_rpmconfigdir}/rpm.daily
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d
install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/rpm install -m 644 scripts/rpm.log ${RPM_BUILD_ROOT}%{_sysconfdir}/logrotate.d/rpm
@ -310,6 +323,9 @@ make clean
%exclude %{_mandir}/man8/rpmspec.8.gz %exclude %{_mandir}/man8/rpmspec.8.gz
%changelog %changelog
* Tue Sep 05 2023 renhongxun<renhongxun@h-partners.com> - 4.18.1-6
- Fix the coredump which may occur during upgrading of rpm
* Tue Sep 5 2023 hongjinghao<hongjinghao@huawei.com> - 4.18.1-5 * Tue Sep 5 2023 hongjinghao<hongjinghao@huawei.com> - 4.18.1-5
- Fix a segfault on a non-stringable argument to macro call from Lua - Fix a segfault on a non-stringable argument to macro call from Lua