Use %sysusers_create_compat instead of useradd

See https://docs.fedoraproject.org/en-US/packaging-guidelines/UsersAndGroups/

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2046458
This commit is contained in:
Petr Lautrbach 2022-02-08 16:47:26 +01:00
parent e53fbd0923
commit 73eee022be
2 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ License: GPLv2+
URL: https://gitlab.com/setroubleshoot/setroubleshoot URL: https://gitlab.com/setroubleshoot/setroubleshoot
Source0: https://gitlab.com/setroubleshoot/setroubleshoot/-/archive/%{version}/setroubleshoot-%{version}.tar.gz Source0: https://gitlab.com/setroubleshoot/setroubleshoot/-/archive/%{version}/setroubleshoot-%{version}.tar.gz
Source1: %{name}.tmpfiles Source1: %{name}.tmpfiles
Source2: %{name}.sysusers
# git format-patch -N 3.3.27 # git format-patch -N 3.3.27
# i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done # i=1; for j in 00*patch; do printf "Patch%04d: %s\n" $i $j; i=$((i+1));done
BuildRequires: gcc BuildRequires: gcc
@ -39,7 +40,6 @@ Requires: xdg-utils
%global pkgvardatadir %{_localstatedir}/lib/%{name} %global pkgvardatadir %{_localstatedir}/lib/%{name}
%global pkgconfigdir %{_sysconfdir}/%{name} %global pkgconfigdir %{_sysconfdir}/%{name}
%global pkgdatabase %{pkgvardatadir}/setroubleshoot_database.xml %global pkgdatabase %{pkgvardatadir}/setroubleshoot_database.xml
%global username setroubleshoot
%description %description
setroubleshoot GUI. Application that allows you to view setroubleshoot-server setroubleshoot GUI. Application that allows you to view setroubleshoot-server
@ -113,7 +113,7 @@ about the problem and help track its resolution. Alerts can be configured
to user preference. The same tools can be run on existing log files. to user preference. The same tools can be run on existing log files.
%pre server %pre server
getent passwd %{username} >/dev/null || useradd -r -U -s /sbin/nologin -d %{pkgvardatadir} %{username} %sysusers_create_compat %{SOURCE2}
%post server %post server
/sbin/service auditd reload >/dev/null 2>&1 || : /sbin/service auditd reload >/dev/null 2>&1 || :

1
setroubleshoot.sysusers Normal file
View File

@ -0,0 +1 @@
u setroubleshoot - "SELinux troubleshoot server" /var/lib/setroubleshoot