fix the SELinux label missing issue
This commit is contained in:
parent
f1dbaf3dc5
commit
c4ed0d9b3a
@ -2,7 +2,7 @@
|
||||
|
||||
Name: tpm2-abrmd
|
||||
Version: 2.3.3
|
||||
Release: 1
|
||||
Release: 2
|
||||
Summary: A system daemon implementing the TPM2 access broker (TAB) & Resource Manager (RM) spec from the TCG
|
||||
License: BSD
|
||||
URL: https://github.com/tpm2-software/tpm2-abrmd
|
||||
@ -14,7 +14,7 @@ BuildRequires: chrpath
|
||||
BuildRequires: selinux-policy-devel pkgconfig(systemd)
|
||||
|
||||
# tpm2-abrmd depends on the package that contains itsSELinux policy module
|
||||
Requires: (%{name}-selinux >= 2.0.0-1 if selinux-policy-%{selinuxtype})
|
||||
Requires: (%{name}-selinux >= 2.3.3-2 if selinux-policy)
|
||||
|
||||
%description
|
||||
This is a system daemon implementing the TPM2 access broker (TAB) & Resource Manager (RM) spec from the TCG.
|
||||
@ -35,7 +35,7 @@ This package contains development library files, headers and config files of tpm
|
||||
BuildArch: noarch
|
||||
Summary: SELinux policies for tpm2-abrmd
|
||||
Requires: selinux-policy >= 0.0.1
|
||||
Requires(post): selinux-policy-base >= 0.0.1
|
||||
Requires(post): selinux-policy-%{selinuxtype}
|
||||
Requires(post): libselinux-utils
|
||||
Requires(post): policycoreutils
|
||||
Requires(post): policycoreutils-python-utils
|
||||
@ -75,8 +75,6 @@ echo "/usr/lib64/" > $RPM_BUILD_ROOT/etc/ld.so.conf.d/%{name}-%{_arch}.conf
|
||||
make test
|
||||
|
||||
%pre
|
||||
%selinux_relabel_pre -s targeted
|
||||
|
||||
#add a user to sandbox the tpm2-abrmd daemon
|
||||
getent group tss >/dev/null || groupadd -g 59 -r tss
|
||||
getent passwd tss >/dev/null || \
|
||||
@ -84,23 +82,29 @@ useradd -r -u 59 -g tss -d /dev/null -s /sbin/nologin \
|
||||
-c "Account used by the tpm2-abrmd package to sandbox the tpm2-abrmd daemon" tss
|
||||
exit 0
|
||||
|
||||
%pre selinux
|
||||
%selinux_relabel_pre -s targeted
|
||||
|
||||
%preun
|
||||
%systemd_preun tpm2-abrmd.service
|
||||
|
||||
%post
|
||||
/sbin/ldconfig
|
||||
%systemd_post tpm2-abrmd.service
|
||||
|
||||
%post selinux
|
||||
%selinux_modules_install -s targeted %{_datadir}/selinux/packages/tabrmd.pp.bz2
|
||||
|
||||
%postun
|
||||
/sbin/ldconfig
|
||||
%systemd_postun tpm2-abrmd.service
|
||||
|
||||
%postun selinux
|
||||
if [ $1 -eq 0 ]; then
|
||||
%selinux_modules_uninstall -s targeted tabrmd
|
||||
fi
|
||||
|
||||
%posttrans
|
||||
%posttrans selinux
|
||||
%selinux_relabel_post -s targeted
|
||||
|
||||
%files
|
||||
@ -133,6 +137,12 @@ fi
|
||||
%{_datadir}/selinux/packages/tabrmd.pp.bz2
|
||||
|
||||
%changelog
|
||||
* Tue May 25 2021 Hugel<gengqihu1@huawei.com> - 2.3.3-2
|
||||
- Type:bugfix
|
||||
- ID:NA
|
||||
- SUG:NA
|
||||
- DESC:fix the SELinux label missing issue
|
||||
|
||||
* Mon Aug 31 2020 Hugel<gengqihu1@huawei.com> - 2.3.3-1
|
||||
- Type:enhancement
|
||||
- ID:NA
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user