mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-21 18:02:18 +00:00
fix(xcat-core): the erase of xCAT-selinux leaves three files unlabeled_t
%postun removed the module and relabelled nothing, so the two entrypoint types left the policy while three files still carried them. The files became unlabeled_t, and /install kept public_content_t, which the stock policy does not define for it. %preun now saves the file contexts, because %pre does not run on an erase, and %postun relabels after the module is removed, on an erase only. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
@@ -49,8 +49,16 @@ install -m 0644 xcat.pp.bz2 $RPM_BUILD_ROOT%{_datadir}/selinux/packages/targeted
|
||||
%post
|
||||
%selinux_modules_install -s targeted %{_datadir}/selinux/packages/targeted/xcat.pp.bz2
|
||||
|
||||
%preun
|
||||
# %pre does not run on an erase, and %postun needs the snapshot to find the
|
||||
# files whose context the removed module defined.
|
||||
%selinux_relabel_pre -s targeted
|
||||
|
||||
%postun
|
||||
%selinux_modules_uninstall -s targeted xcat
|
||||
if [ $1 -eq 0 ]; then
|
||||
%selinux_relabel_post -s targeted
|
||||
fi
|
||||
|
||||
%posttrans
|
||||
%selinux_relabel_post -s targeted
|
||||
|
||||
Reference in New Issue
Block a user