From 5e3b0e1f2a59125022bbb9e9430ab0dcee599ecc Mon Sep 17 00:00:00 2001 From: Lukas Vrabec Date: Sun, 3 Nov 2019 15:00:33 +0100 Subject: [PATCH] Update selinux-policy macros from upstream repo Upstream repo: https://github.com/fedora-selinux/selinux-policy-macros Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1723940 --- rpm.macros | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/rpm.macros b/rpm.macros index 6e62d456..95df104c 100644 --- a/rpm.macros +++ b/rpm.macros @@ -48,7 +48,9 @@ Requires(post): policycoreutils-python \ # %selinux_modules_install [-s ] [-p ] module [module]... %selinux_modules_install("s:p:") \ -. /etc/selinux/config \ +if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ +fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ @@ -61,7 +63,9 @@ fi \ # %selinux_modules_uninstall [-s ] [-p ] module [module]... %selinux_modules_uninstall("s:p:") \ -. /etc/selinux/config \ +if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ +fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ @@ -77,7 +81,9 @@ fi \ # %selinux_relabel_pre [-s ] %selinux_relabel_pre("s:") \ if %{_sbindir}/selinuxenabled; then \ - . /etc/selinux/config \ + if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ + fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ @@ -91,7 +97,9 @@ fi \ # %selinux_relabel_post [-s ] %selinux_relabel_post("s:") \ -. /etc/selinux/config \ +if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ +fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ @@ -106,7 +114,9 @@ fi \ # %selinux_set_booleans [-s ] boolean [boolean]... %selinux_set_booleans("s:") \ -. /etc/selinux/config \ +if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ +fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \ @@ -145,7 +155,9 @@ fi \ # %selinux_unset_booleans [-s ] boolean [boolean]... %selinux_unset_booleans("s:") \ -. /etc/selinux/config \ +if [ -e /etc/selinux/config ]; then \ + . /etc/selinux/config \ +fi \ _policytype=%{-s*} \ if [ -z "${_policytype}" ]; then \ _policytype="targeted" \