Skip to content

Commit

Permalink
use systemd-sysusers
Browse files Browse the repository at this point in the history
Signed-off-by: Jonathan <[email protected]>
  • Loading branch information
jonathanspw committed Jul 18, 2023
1 parent d02533c commit 8382699
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/actions/build-sssd-srpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ runs:
tar -cvzf "$name.tar.gz" --transform "s,^,$name/," *
cp contrib/sssd.spec.in ./sssd.spec
cp contrib/sssd.sysusers ./sssd.sysusers
sed -iE "s/@PACKAGE_NAME@/sssd/g" ./sssd.spec
sed -iE "s/@PACKAGE_VERSION@/${{ steps.sanitize.outputs.version }}/g" ./sssd.spec
Expand Down
13 changes: 10 additions & 3 deletions contrib/sssd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ Summary: System Security Services Daemon
License: GPLv3+
URL: https://github.com/SSSD/sssd/
Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz
Source1: sssd.sysusers

### Patches ###
# Place your patches here:
Expand Down Expand Up @@ -188,7 +189,8 @@ Requires: (sssd-nfs-idmap = %{version}-%{release} if libnfsidmap)
Requires: libsss_idmap = %{version}-%{release}
Requires: libsss_certmap = %{version}-%{release}
%if 0%{?rhel}
Requires(pre): shadow-utils
BuildRequires: systemd-rpm-macros
%{?sysusers_requires_compat}
%endif
%{?systemd_requires}

Expand Down Expand Up @@ -701,6 +703,8 @@ do
cat $subpackage.lang
done

install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf

%files
%license COPYING

Expand Down Expand Up @@ -804,6 +808,10 @@ done
%{_datadir}/systemtap/tapset/sssd.stp
%{_datadir}/systemtap/tapset/sssd_functions.stp
%{_mandir}/man5/sssd-systemtap.5*
%if 0%{?rhel} >= 9 || 0%{?fedora}
%{_sysusersdir}/sssd.conf
%endif


%if 0%{?rhel}
%files polkit-rules
Expand Down Expand Up @@ -1003,8 +1011,7 @@ done

%if 0%{?rhel}
%pre common
getent group sssd >/dev/null || groupadd -r sssd
getent passwd sssd >/dev/null || useradd -r -g sssd -d / -s /sbin/nologin -c "User for sssd" sssd
%sysusers_create_compat %{SOURCE1}
%endif

%post common
Expand Down
1 change: 1 addition & 0 deletions contrib/sssd.sysusers
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
u sssd - "User for sssd" / /sbin/nologin

0 comments on commit 8382699

Please sign in to comment.