From 57e796b2c608cf2a77f86e952bdbeea36769f04a 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 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. --- 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 90bb5bbdd0e..0bd49b0a555 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