From e66f4c2f3673833ae0aac94fd60dbeb061c5b088 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: May 16 2024 22:18:01 +0000 Subject: Correct some errors in the RPM macro changes from -2 The commands should always end || : , because by policy we should ensure RPM scriptlets always exit 0: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax Also, rm is in _bindir, not _sbindir. This seems to have caused a failed test for an nbdkit update: https://openqa.fedoraproject.org/tests/2628713# the live image build failed because of a scriptlet error that seems to be caused by this: INFO:anaconda.modules.payloads.payload.dnf.transaction_progress:Configuring (running scriptlet for): nbdkit-selinux-1.39.6-1.fc41.noarch 1715870254 02561380439e4e22473970fa46db331b277dc254650fdcb96130a056cadaf02f INFO:dnf.rpm:/var/tmp/rpm-tmp.ycmrWv: line 10: /usr/sbin/rm: No such file or directory warning: %post(nbdkit-selinux-1.39.6-1.fc41.noarch) scriptlet failed, exit status 1 ERROR:dnf.rpm:Error in POSTIN scriptlet in rpm package nbdkit-selinux Signed-off-by: Adam Williamson --- diff --git a/rpm.macros b/rpm.macros index dcab018..6661955 100644 --- a/rpm.macros +++ b/rpm.macros @@ -55,10 +55,10 @@ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ fi \ if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ - %{_sbindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun \ + %{_bindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun || : \ %{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* || : \ %{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \ - %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} \ + %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} || : \ fi \ %{nil} @@ -73,10 +73,10 @@ if [ -z "${_policytype}" ]; then \ fi \ if [ $1 -eq 0 ]; then \ if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \ - %{_sbindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun \ + %{_bindir}/rm -rf %{_sharedstatedir}/selinux/${_policytype}/active/modules/400/extra_varrun || : \ %{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \ %{_sbindir}/selinuxenabled && %{_sbindir}/load_policy || : \ - %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} \ + %{_libexecdir}/selinux/varrun-convert.sh ${_policytype} || : \ fi \ fi \ %{nil} diff --git a/selinux-policy.spec b/selinux-policy.spec index ba30725..a28c427 100644 --- a/selinux-policy.spec +++ b/selinux-policy.spec @@ -24,7 +24,7 @@ Summary: SELinux policy configuration Name: selinux-policy Version: 40.18 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL-2.0-or-later Source: %{giturl}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz Source1: modules-targeted-base.conf @@ -860,6 +860,9 @@ exit 0 %endif %changelog +* Thu May 16 2024 Adam Williamson - 40.18-3 +- Correct some errors in the RPM macro changes from -2 + * Mon May 06 2024 Zdenek Pytela - 40.18-2 - Update rpm configuration for the /var/run equivalency change