Create tss user, if it doesn't exist, for userspace TPM access

This commit is contained in:
Peter Robinson 2020-09-15 12:02:06 +01:00
parent 44bdbce275
commit ab073a1975

View File

@ -1,6 +1,6 @@
Name: tpm2-tss Name: tpm2-tss
Version: 3.0.0 Version: 3.0.0
Release: 2%{?dist} Release: 3%{?dist}
Summary: TPM2.0 Software Stack Summary: TPM2.0 Software Stack
# The entire source code is under BSD except implementation.h and tpmb.h which # The entire source code is under BSD except implementation.h and tpmb.h which
@ -22,6 +22,7 @@ BuildRequires: libtool
BuildRequires: openssl-devel BuildRequires: openssl-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: systemd BuildRequires: systemd
Requires(pre): shadow-utils
%description %description
tpm2-tss is a software stack supporting Trusted Platform Module(TPM) 2.0 system tpm2-tss is a software stack supporting Trusted Platform Module(TPM) 2.0 system
@ -47,6 +48,17 @@ sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
%make_install %make_install
find %{buildroot}%{_libdir} -type f -name \*.la -delete find %{buildroot}%{_libdir} -type f -name \*.la -delete
%pre
getent group tss >/dev/null || groupadd -f -g 59 -r tss
if ! getent passwd tss >/dev/null ; then
if ! getent passwd 59 >/dev/null ; then
useradd -r -u 59 -g tss -d /dev/null -s /sbin/nologin -c "Account used for TPM access" tss
else
useradd -r -g tss -d /dev/null -s /sbin/nologin -c "Account used for TPM access" tss
fi
fi
exit 0
%ldconfig_scriptlets %ldconfig_scriptlets
%files %files
@ -103,6 +115,9 @@ use tpm2-tss.
%changelog %changelog
* Tue Sep 15 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 3.0.0-3
- Create tss user, if it doesn't exist, for userspace TPM access
* Fri Aug 07 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 3.0.0-2 * Fri Aug 07 2020 Peter Robinson <pbrobinson@fedoraproject.org> - 3.0.0-2
- Install sysusers config in sysusersdir (rhbz #1834519) - Install sysusers config in sysusersdir (rhbz #1834519)