From 38124986f4d8f0893ff9a80ea148bd38b3c79529321341f8aa4ba3f5c206f81d Mon Sep 17 00:00:00 2001 From: Peter Varkoly Date: Wed, 18 Nov 2020 10:13:33 +0000 Subject: [PATCH] Accepting request 848371 from home:kukuk:container - Check first if they exist before creating user and group accounts - Use macro for systemd-tmpfiles call - Pre-Require shadow if we use it in %pre OBS-URL: https://build.opensuse.org/request/show/848371 OBS-URL: https://build.opensuse.org/package/show/server:mail/dovecot?expand=0&rev=20 --- dovecot.changes | 11 +++++++++++ dovecot.spec | 9 +++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/dovecot.changes b/dovecot.changes index c30ce0e..775a4ad 100644 --- a/dovecot.changes +++ b/dovecot.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Fri Nov 13 14:11:59 UTC 2020 - Thorsten Kukuk + +- Check first if they exist before creating user and group accounts + +------------------------------------------------------------------- +Thu Nov 5 14:33:43 UTC 2020 - Thorsten Kukuk + +- Use macro for systemd-tmpfiles call +- Pre-Require shadow if we use it in %pre + ------------------------------------------------------------------- Wed Jul 15 14:29:02 UTC 2020 - Thorsten Kukuk diff --git a/dovecot.spec b/dovecot.spec index e6e9728..7c7e3d4 100644 --- a/dovecot.spec +++ b/dovecot.spec @@ -30,6 +30,7 @@ License: BSD-3-Clause AND LGPL-2.1-or-later AND MIT Group: Productivity/Networking/Email/Servers URL: http://www.dovecot.org/ PreReq: dovecot-implementation +PreReq: shadow Recommends: dovecot23 #!BuildIgnore: dovecot-implementation BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -93,9 +94,9 @@ install -D -m 0644 %{S:9} %{buildroot}%{_unitdir}/dovecot.socket %{buildroot}%{_var}/lib/%{name}/ %pre -/usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || : -/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name} >/dev/null 2>&1 || : -/usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull >/dev/null 2>&1 || : +getent group %{name} > /dev/null || /usr/sbin/groupadd -r %{name} >/dev/null 2>&1 || : +getent passwd %{name} > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot imapd" -d %{_var}/run/%{name} %{name} >/dev/null 2>&1 || : +getent passwd dovenull > /dev/null || /usr/sbin/useradd -g %{name} -s /bin/false -r -c "User for Dovecot login" -d %{_var}/run/%{name} dovenull >/dev/null 2>&1 || : # try to copy the default configuration. # # we fail silently if the dovecot-implementation package is not @@ -121,7 +122,7 @@ fi %if %{with systemd} %post -systemd-tmpfiles --create /usr/lib/tmpfiles.d/dovecot.conf || true +%tmpfiles_create dovecot.conf %service_add_post %{name}.service %{name}.socket %endif