From 73eee022bec1195423827a4e7394bbc451bf77da Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: Tue, 8 Feb 2022 16:47:26 +0100 Subject: [PATCH] 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 --- setroubleshoot.spec | 4 ++-- setroubleshoot.sysusers | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 setroubleshoot.sysusers diff --git a/setroubleshoot.spec b/setroubleshoot.spec index 341bb53..e2240a5 100644 --- a/setroubleshoot.spec +++ b/setroubleshoot.spec @@ -9,6 +9,7 @@ License: GPLv2+ URL: https://gitlab.com/setroubleshoot/setroubleshoot Source0: https://gitlab.com/setroubleshoot/setroubleshoot/-/archive/%{version}/setroubleshoot-%{version}.tar.gz Source1: %{name}.tmpfiles +Source2: %{name}.sysusers # 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 BuildRequires: gcc @@ -39,7 +40,6 @@ Requires: xdg-utils %global pkgvardatadir %{_localstatedir}/lib/%{name} %global pkgconfigdir %{_sysconfdir}/%{name} %global pkgdatabase %{pkgvardatadir}/setroubleshoot_database.xml -%global username setroubleshoot %description 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. %pre server -getent passwd %{username} >/dev/null || useradd -r -U -s /sbin/nologin -d %{pkgvardatadir} %{username} +%sysusers_create_compat %{SOURCE2} %post server /sbin/service auditd reload >/dev/null 2>&1 || : diff --git a/setroubleshoot.sysusers b/setroubleshoot.sysusers new file mode 100644 index 0000000..59e8048 --- /dev/null +++ b/setroubleshoot.sysusers @@ -0,0 +1 @@ +u setroubleshoot - "SELinux troubleshoot server" /var/lib/setroubleshoot