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
This commit is contained in:
Martin Pluskal 2016-07-30 15:21:33 +00:00 committed by Git OBS Bridge
parent 5ddd4e358b
commit 504d29f27e
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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