- Conditionally run semanage only when SELinux is

enabled

Resolves: RHBZ#2150908
This commit is contained in:
Link Dupont 2023-01-30 12:33:52 -05:00 committed by Pino Toscano
parent eb84bc9b92
commit 508fa0390b

View File

@ -3,7 +3,7 @@
Name: insights-client
Summary: Uploads Insights information to Red Hat on a periodic basis
Version: 3.1.7
Release: 12%{?dist}
Release: 13%{?dist}
Source0: https://github.com/RedHatInsights/insights-client/releases/download/v%{version}/insights-client-%{version}.tar.gz
Source1: https://api.access.redhat.com/r/insights/v1/static/core/insights-core.egg
Source2: https://api.access.redhat.com/r/insights/v1/static/core/insights-core.egg.asc
@ -84,7 +84,9 @@ if [ -d %{_sysconfdir}/motd.d ]; then
fi
fi
semanage permissive --add insights_client_t
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
/usr/sbin/semanage permissive --add insights_client_t || true
fi
%preun
%systemd_preun %{name}.timer
@ -97,7 +99,9 @@ semanage permissive --add insights_client_t
%systemd_postun %{name}-boot.service
if [ $1 -eq 0 ]; then
%{_sbindir}/semanage permissive -d insights_client_t || true
if [ -x /usr/sbin/selinuxenabled ] && /usr/sbin/selinuxenabled; then
/usr/sbin/semanage permissive --delete insights_client_t || true
fi
fi
# Clean up files created by insights-client that are unowned by the RPM
@ -141,6 +145,9 @@ rm -rf %{buildroot}
%changelog
* Thu May 18 2023 Pino Toscano <ptoscano@redhat.com> - 0:3.1.7-13
- Conditionally run semanage only when SELinux is enabled (RHBZ#2196844)
* Thu Nov 10 2022 Alba Hita Catala <ahitacat@redhat.com> 0:3.1.7-12
- Set SELinux policy to permissive for rhcd_t module (RHBZ#2141443)