Fix restorecon to not error on missing directory

This commit is contained in:
Daniel J Walsh 2018-08-27 09:17:30 -04:00
parent 1c6b7ec5b2
commit 5c39536b9a
No known key found for this signature in database
GPG Key ID: A2DF901DABE2C028

View File

@ -27,7 +27,7 @@ Name: container-selinux
Epoch: 2
%endif
Version: 2.71
Release: 1.git%{shortcommit0}%{?dist}
Release: 2.git%{shortcommit0}%{?dist}
License: GPLv2
URL: %{git0}
Summary: SELinux policies for container runtimes
@ -86,10 +86,12 @@ if %{_sbindir}/selinuxenabled ; then
%relabel_files
if [ $1 -eq 1 ]; then
restorecon -R %{_sharedstatedir}/docker &> /dev/null || :
restorecon -R %{_sharedstatedir}/containers &> /dev/null || :
fi
fi
. %{_sysconfdir}/selinux/config
sed -e "\|container_file_t|h; \${x;s|container_file_t||;{g;t};a\\" -e "container_file_t" -e "}" -i /etc/selinux/${SELINUXTYPE}/contexts/customizable_types
matchpathcon -qV %{_sharedstatedir}/containers || restorecon -R %{_sharedstatedir}/containers &> /dev/null || :
%postun
@ -109,6 +111,9 @@ fi
%{_datadir}/selinux/*
%changelog
* Mon Aug 27 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.71-2
- Fix restorecon to not error on missing directory
* Wed Aug 22 2018 Dan Walsh <dwalsh@fedoraproject.org> - 2.71-1
- Allow unconfined_r to transition to system_r over container_runtime_exec_t