Skip to content

Commit

Permalink
SPEC: use '/run/sssd' as a home dir for 'sssd' user
Browse files Browse the repository at this point in the history
even if 'sssd.sysusers' aren't used.
Practically this is only important for C9S, since C10S and
modern Fedora versions do use 'sssd.sysusers'

Also use `usermod` to update home dir in case user already exists.

Reviewed-by: Pavel Březina <[email protected]>
Reviewed-by: Sumit Bose <[email protected]>
  • Loading branch information
alexey-tikhonov committed Sep 27, 2024
1 parent 312e0eb commit 10bf7ab
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/sssd.spec.in
Original file line number Diff line number Diff line change
Expand Up @@ -1097,11 +1097,12 @@ install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_sysusersdir}/sssd.conf

%if %{use_sssd_user}
%pre common
! getent passwd sssd >/dev/null || usermod sssd -d /run/sssd >/dev/null || true
%if %{use_sysusers}
%sysusers_create_compat %{SOURCE1}
%else
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
getent passwd sssd >/dev/null || useradd -r -g sssd -d /run/sssd -s /sbin/nologin -c "User for sssd" sssd
%endif
%endif

Expand Down

0 comments on commit 10bf7ab

Please sign in to comment.