From 10bf7ab415a68bf89dd62f90f8d33bd83df0f750 Mon Sep 17 00:00:00 2001 From: Alexey Tikhonov Date: Tue, 24 Sep 2024 10:43:35 +0200 Subject: [PATCH] SPEC: use '/run/sssd' as a home dir for 'sssd' user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Sumit Bose --- contrib/sssd.spec.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/sssd.spec.in b/contrib/sssd.spec.in index 67e8dcba2b5..0f71783f82e 100644 --- a/contrib/sssd.spec.in +++ b/contrib/sssd.spec.in @@ -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