Backport new selinux-policy rpm macros from github repo:
https://github.com/fedora-selinux/selinux-policy-macros.git Main point of this change is to allow set SELinux Module priority in selinux_modules_(u)install() macros.
This commit is contained in:
parent
6fc6359b10
commit
37cf7d764b
17
rpm.macros
17
rpm.macros
@ -1,4 +1,7 @@
|
|||||||
# Copyright (C) 2016 Petr Lautrbach
|
# Copyright (C) 2017 Red Hat, Inc. All rights reserved.
|
||||||
|
#
|
||||||
|
# Author: Petr Lautrbach <plautrba@redhat.com>
|
||||||
|
# Author: Lukáš Vrabec <lvrabec@redhat.com>
|
||||||
#
|
#
|
||||||
# This program is free software; you can redistribute it and/or
|
# This program is free software; you can redistribute it and/or
|
||||||
# modify it under the terms of the GNU General Public License
|
# modify it under the terms of the GNU General Public License
|
||||||
@ -23,28 +26,28 @@
|
|||||||
%_file_custom_defined_booleans %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom
|
%_file_custom_defined_booleans %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom
|
||||||
%_file_custom_defined_booleans_tmp %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom.tmp
|
%_file_custom_defined_booleans_tmp %{_sharedstatedir}/selinux/${_policytype}/rpmbooleans.custom.tmp
|
||||||
|
|
||||||
# %selinux_modules_install [-s <policytype>] module [module]...
|
# %selinux_modules_install [-s <policytype>] [-p <modulepriority>] module [module]...
|
||||||
%selinux_modules_install("s:") \
|
%selinux_modules_install("s:p:") \
|
||||||
. /etc/selinux/config \
|
. /etc/selinux/config \
|
||||||
_policytype=%{-s*} \
|
_policytype=%{-s*} \
|
||||||
if [ -z "${_policytype}" ]; then \
|
if [ -z "${_policytype}" ]; then \
|
||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
%{_sbindir}/semodule -n -s ${_policytype} -X 200 -i %* \
|
%{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
%{_sbindir}/load_policy \
|
%{_sbindir}/load_policy \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# %selinux_modules_uninstall [-s <policytype>] module [module]...
|
# %selinux_modules_uninstall [-s <policytype>] [-p <modulepriority>] module [module]...
|
||||||
%selinux_modules_uninstall("s:") \
|
%selinux_modules_uninstall("s:p:") \
|
||||||
. /etc/selinux/config \
|
. /etc/selinux/config \
|
||||||
_policytype=%{-s*} \
|
_policytype=%{-s*} \
|
||||||
if [ -z "${_policytype}" ]; then \
|
if [ -z "${_policytype}" ]; then \
|
||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
if [ $1 -eq 0 ]; then \
|
if [ $1 -eq 0 ]; then \
|
||||||
%{_sbindir}/semodule -n -X 200 -r %* &> /dev/null || : \
|
%{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -r %* &> /dev/null || : \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
%{_sbindir}/load_policy \
|
%{_sbindir}/load_policy \
|
||||||
fi \
|
fi \
|
||||||
|
Loading…
Reference in New Issue
Block a user