From 504d29f27e7b7545386c44af1ad637de2e0ede475915a9057de7628763ccfff5 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Sat, 30 Jul 2016 15:21:33 +0000 Subject: [PATCH] Accepting request 416034 from home:jengelh:branches:server:database - Test for user/group existence before creating them. Request shadow to be present for the scriptlet. OBS-URL: https://build.opensuse.org/request/show/416034 OBS-URL: https://build.opensuse.org/package/show/server:database/redis?expand=0&rev=81 --- redis.changes | 6 ++++++ redis.spec | 7 +++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/redis.changes b/redis.changes index 31bc75f..4635ac7 100644 --- a/redis.changes +++ b/redis.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Jul 30 12:30:02 UTC 2016 - jengelh@inai.de + +- Test for user/group existence before creating them. + Request shadow to be present for the scriptlet. + ------------------------------------------------------------------- Sat Jul 30 10:06:22 UTC 2016 - astieger@suse.com diff --git a/redis.spec b/redis.spec index 0007479..7897870 100644 --- a/redis.spec +++ b/redis.spec @@ -46,6 +46,7 @@ Patch3: CVE-2013-7458.patch BuildRequires: pkgconfig BuildRequires: procps BuildRequires: tcl +Requires(pre): shadow Requires: logrotate Requires: sudo BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -128,8 +129,10 @@ make %{?_smp_mflags} test && true %endif %pre -%{_sbindir}/groupadd -r %{name} >/dev/null 2>&1 || : -%{_sbindir}/useradd -g %{name} -s /bin/false -r -c "User for Redis key-value store" -d %{_data_dir} %{name} >/dev/null 2>&1 || : +getent group %{name} >/dev/null || %{_sbindir}/groupadd -r %{name} || : +getent passwd %{name} >/dev/null || \ + %{_sbindir}/useradd -g %{name} -s /bin/false -r \ + -c "User for Redis key-value store" -d %{_data_dir} %{name} || : %if %{with systemd} %service_add_pre %{name}.target %endif