* Sat Oct 13 2018 Lukas Vrabec <lvrabec@redhat.com> - 3.14.3-7
- Update rpm macros for selinux policy from sources repository: https://github.com/fedora-selinux/selinux-policy-macros
This commit is contained in:
parent
729e95002a
commit
146094f7a3
107
rpm.macros
107
rpm.macros
@ -21,12 +21,13 @@
|
|||||||
%_selinux_policy_version SELINUXPOLICYVERSION
|
%_selinux_policy_version SELINUXPOLICYVERSION
|
||||||
|
|
||||||
%_selinux_store_path SELINUXSTOREPATH
|
%_selinux_store_path SELINUXSTOREPATH
|
||||||
|
%_selinux_store_policy_path %{_selinux_store_path}/${_policytype}
|
||||||
|
|
||||||
%_file_context_file %{_sysconfdir}/selinux/${SELINUXTYPE}/contexts/files/file_contexts
|
%_file_context_file %{_sysconfdir}/selinux/${SELINUXTYPE}/contexts/files/file_contexts
|
||||||
%_file_context_file_pre %{_localstatedir}/lib/rpm-state/file_contexts.pre
|
%_file_context_file_pre %{_localstatedir}/lib/rpm-state/file_contexts.pre
|
||||||
|
|
||||||
%_file_custom_defined_booleans %{_selinux_store_path}/${_policytype}/rpmbooleans.custom
|
%_file_custom_defined_booleans %{_selinux_store_policy_path}/rpmbooleans.custom
|
||||||
%_file_custom_defined_booleans_tmp %{_selinux_store_path}/${_policytype}/rpmbooleans.custom.tmp
|
%_file_custom_defined_booleans_tmp %{_selinux_store_policy_path}/rpmbooleans.custom.tmp
|
||||||
|
|
||||||
# %selinux_requires
|
# %selinux_requires
|
||||||
%selinux_requires \
|
%selinux_requires \
|
||||||
@ -38,7 +39,7 @@ BuildRequires: selinux-policy-devel \
|
|||||||
Requires(post): selinux-policy-base >= %{_selinux_policy_version} \
|
Requires(post): selinux-policy-base >= %{_selinux_policy_version} \
|
||||||
Requires(post): libselinux-utils \
|
Requires(post): libselinux-utils \
|
||||||
Requires(post): policycoreutils \
|
Requires(post): policycoreutils \
|
||||||
%if 0%{?fedora} \
|
%if 0%{?fedora} || 0%{?rhel} > 7\
|
||||||
Requires(post): policycoreutils-python-utils \
|
Requires(post): policycoreutils-python-utils \
|
||||||
%else \
|
%else \
|
||||||
Requires(post): policycoreutils-python \
|
Requires(post): policycoreutils-python \
|
||||||
@ -52,9 +53,9 @@ _policytype=%{-s*} \
|
|||||||
if [ -z "${_policytype}" ]; then \
|
if [ -z "${_policytype}" ]; then \
|
||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
%{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* \
|
if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
%{_sbindir}/semodule -n -s ${_policytype} -X %{!-p:200}%{-p*} -i %* \
|
||||||
%{_sbindir}/load_policy \
|
%{_sbindir}/selinuxenabled && %{_sbindir}/load_policy \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
@ -66,9 +67,9 @@ if [ -z "${_policytype}" ]; then \
|
|||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
if [ $1 -eq 0 ]; then \
|
if [ $1 -eq 0 ]; then \
|
||||||
%{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \
|
if [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
%{_sbindir}/semodule -n -X %{!-p:200}%{-p*} -s ${_policytype} -r %* &> /dev/null || : \
|
||||||
%{_sbindir}/load_policy \
|
%{_sbindir}/selinuxenabled && %{_sbindir}/load_policy \
|
||||||
fi \
|
fi \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
@ -108,33 +109,35 @@ _policytype=%{-s*} \
|
|||||||
if [ -z "${_policytype}" ]; then \
|
if [ -z "${_policytype}" ]; then \
|
||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
LOCAL_MODIFICATIONS=$(semanage boolean -E) \
|
if [ -d "%{_selinux_store_policy_path}" ]; then \
|
||||||
if [ ! -f %_file_custom_defined_booleans ]; then \
|
LOCAL_MODIFICATIONS=$(%{_sbindir}/semanage boolean -E) \
|
||||||
/bin/echo "# This file is managed by macros.selinux-policy. Do not edit it manually" > %_file_custom_defined_booleans \
|
if [ ! -f %_file_custom_defined_booleans ]; then \
|
||||||
fi \
|
/bin/echo "# This file is managed by macros.selinux-policy. Do not edit it manually" > %_file_custom_defined_booleans \
|
||||||
semanage_import='' \
|
fi \
|
||||||
for boolean in %*; do \
|
semanage_import='' \
|
||||||
boolean_name=${boolean%=*} \
|
for boolean in %*; do \
|
||||||
boolean_value=${boolean#*=} \
|
boolean_name=${boolean%=*} \
|
||||||
boolean_local_string=$(grep "$boolean_name\$" <<<$LOCAL_MODIFICATIONS) \
|
boolean_value=${boolean#*=} \
|
||||||
if [ -n "$boolean_local_string" ]; then \
|
boolean_local_string=$(grep "$boolean_name\$" <<<$LOCAL_MODIFICATIONS) \
|
||||||
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
|
if [ -n "$boolean_local_string" ]; then \
|
||||||
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
|
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
|
||||||
if [ -n "$boolean_customized_string" ]; then \
|
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
|
||||||
/bin/echo $boolean_customized_string >> %_file_custom_defined_booleans \
|
if [ -n "$boolean_customized_string" ]; then \
|
||||||
else \
|
/bin/echo $boolean_customized_string >> %_file_custom_defined_booleans \
|
||||||
/bin/echo $boolean_local_string >> %_file_custom_defined_booleans \
|
else \
|
||||||
fi \
|
/bin/echo $boolean_local_string >> %_file_custom_defined_booleans \
|
||||||
else \
|
fi \
|
||||||
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
|
else \
|
||||||
boolean_default_value=$(semanage boolean -l | grep "^$boolean_name " | sed 's/[^(]*([^,]*, *\\(on\\|off\\).*/\\1/') \
|
semanage_import="${semanage_import}\\nboolean -m -$boolean_value $boolean_name" \
|
||||||
/bin/echo "boolean -m --$boolean_default_value $boolean_name" >> %_file_custom_defined_booleans \
|
boolean_default_value=$(LC_ALL=C %{_sbindir}/semanage boolean -l | grep "^$boolean_name " | sed 's/[^(]*([^,]*, *\\(on\\|off\\).*/\\1/') \
|
||||||
fi \
|
/bin/echo "boolean -m --$boolean_default_value $boolean_name" >> %_file_custom_defined_booleans \
|
||||||
done; \
|
fi \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
done; \
|
||||||
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
|
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
else \
|
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
|
||||||
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype} -N" \
|
elif test -d /usr/share/selinux/"${_policytype}"/base.lst; then \
|
||||||
|
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" -N \
|
||||||
|
fi \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
@ -145,20 +148,22 @@ _policytype=%{-s*} \
|
|||||||
if [ -z "${_policytype}" ]; then \
|
if [ -z "${_policytype}" ]; then \
|
||||||
_policytype="targeted" \
|
_policytype="targeted" \
|
||||||
fi \
|
fi \
|
||||||
semanage_import='' \
|
if [ -d "%{_selinux_store_policy_path}" ]; then \
|
||||||
for boolean in %*; do \
|
semanage_import='' \
|
||||||
boolean_name=${boolean%=*} \
|
for boolean in %*; do \
|
||||||
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
|
boolean_name=${boolean%=*} \
|
||||||
if [ -n "$boolean_customized_string" ]; then \
|
boolean_customized_string=$(grep "$boolean_name\$" %_file_custom_defined_booleans | tail -n 1) \
|
||||||
awk "/$boolean_customized_string/ && !f{f=1; next} 1" %_file_custom_defined_booleans > %_file_custom_defined_booleans_tmp && mv %_file_custom_defined_booleans_tmp %_file_custom_defined_booleans \
|
if [ -n "$boolean_customized_string" ]; then \
|
||||||
if ! grep -q "$boolean_name\$" %_file_custom_defined_booleans; then \
|
awk "/$boolean_customized_string/ && !f{f=1; next} 1" %_file_custom_defined_booleans > %_file_custom_defined_booleans_tmp && mv %_file_custom_defined_booleans_tmp %_file_custom_defined_booleans \
|
||||||
semanage_import="${semanage_import}\\n${boolean_customized_string}" \
|
if ! grep -q "$boolean_name\$" %_file_custom_defined_booleans; then \
|
||||||
fi \
|
semanage_import="${semanage_import}\\n${boolean_customized_string}" \
|
||||||
fi \
|
fi \
|
||||||
done; \
|
fi \
|
||||||
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
done; \
|
||||||
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
|
if %{_sbindir}/selinuxenabled && [ "${SELINUXTYPE}" = "${_policytype}" ]; then \
|
||||||
else \
|
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" \
|
||||||
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype} -N" \
|
elif test -d /usr/share/selinux/"${_policytype}"/base.lst; then \
|
||||||
|
/bin/echo -e "$semanage_import" | %{_sbindir}/semanage import -S "${_policytype}" -N \
|
||||||
|
fi \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
Summary: SELinux policy configuration
|
Summary: SELinux policy configuration
|
||||||
Name: selinux-policy
|
Name: selinux-policy
|
||||||
Version: 3.14.3
|
Version: 3.14.3
|
||||||
Release: 6%{?dist}
|
Release: 7%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
Source: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
|
Source: %{git0}/archive/%{commit0}/%{name}-%{shortcommit0}.tar.gz
|
||||||
@ -709,6 +709,9 @@ exit 0
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Oct 13 2018 Lukas Vrabec <lvrabec@redhat.com> - 3.14.3-7
|
||||||
|
- Update rpm macros for selinux policy from sources repository: https://github.com/fedora-selinux/selinux-policy-macros
|
||||||
|
|
||||||
* Tue Oct 09 2018 Lukas Vrabec <lvrabec@redhat.com> - 3.14.3-6
|
* Tue Oct 09 2018 Lukas Vrabec <lvrabec@redhat.com> - 3.14.3-6
|
||||||
- Allow boltd_t to be activated by init socket activation
|
- Allow boltd_t to be activated by init socket activation
|
||||||
- Allow virt_domain to read/write to virtd_t unix_stream socket because of new version of libvirt 4.4. BZ(1635803)
|
- Allow virt_domain to read/write to virtd_t unix_stream socket because of new version of libvirt 4.4. BZ(1635803)
|
||||||
|
Loading…
Reference in New Issue
Block a user