From 59a2a4bfc490b41b226ce7ae4d3f34b1a76d73ec Mon Sep 17 00:00:00 2001 From: Zdenek Pytela Date: Fri, 6 May 2022 14:33:26 +0200 Subject: [PATCH] Run restorecon with "-i" not to report errors The %posttrans scriptlet contains explicit call to restorecon to restore context of files/directories which are not handled properly on updates. When a file or directory does not exist, an error is reported: /usr/sbin/restorecon: lstat(/etc/NetworkManager/dispatcher.d) failed: No such file or directory warning: %posttrans(selinux-policy-targeted-36.8-1.fc36.noarch) scriptlet failed, exit status 255 Error in POSTTRANS scriptlet in rpm package selinux-policy-targeted With the "-i" switch, restorecon does not report an error. Resolves: rhbz#2082547 --- selinux-policy.spec | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/selinux-policy.spec b/selinux-policy.spec index e8a3cc77..fe7e688f 100644 --- a/selinux-policy.spec +++ b/selinux-policy.spec @@ -23,7 +23,7 @@ %define CHECKPOLICYVER 3.2 Summary: SELinux policy configuration Name: selinux-policy -Version: 37.1 +Version: 38.1 Release: 1%{?dist} License: GPLv2+ Source: %{giturl}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz @@ -583,7 +583,7 @@ exit 0 %posttrans targeted %checkConfigConsistency targeted -%{_sbindir}/restorecon -R /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d +%{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d %postun targeted if [ $1 = 0 ]; then @@ -696,7 +696,7 @@ exit 0 %posttrans minimum %checkConfigConsistency minimum -%{_sbindir}/restorecon -R /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d +%{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d %postun minimum if [ $1 = 0 ]; then @@ -770,7 +770,7 @@ exit 0 %posttrans mls %checkConfigConsistency mls -%{_sbindir}/restorecon -R /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d +%{_sbindir}/restorecon -Ri /usr/lib/sysimage/rpm /var/lib/rpm /etc/NetworkManager/dispatcher.d %postun mls if [ $1 = 0 ]; then @@ -813,6 +813,9 @@ exit 0 %endif %changelog +* Fri May 06 2022 Zdenek Pytela - 38.1-1 +- run restorecon with "-i" not to report errors + * Mon May 02 2022 Zdenek Pytela - 37.1-1 - Fix users for SELinux userspace 3.4 - Label /var/run/machine-id as machineid_t