diff --git a/subversion.changes b/subversion.changes index 1128681..004fef3 100644 --- a/subversion.changes +++ b/subversion.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 21 15:57:51 CEST 2011 - pth@suse.de + +- Use getent to check for existance of user and group (bnc#688968). + ------------------------------------------------------------------- Thu Feb 24 11:24:33 UTC 2011 - stsp@elego.de diff --git a/subversion.rcsvnserve b/subversion.rcsvnserve index 0a0d042..36a22bc 100644 --- a/subversion.rcsvnserve +++ b/subversion.rcsvnserve @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (c) 1995-2002 SuSE Linux AG, Nuernberg, Germany. +# Copyright (c) 1995-20011 SuSE Linux AG, Nuernberg, Germany. # All rights reserved. # # /etc/init.d/svnserve @@ -96,17 +96,25 @@ case "$1" in echo -n "Starting svnserve " ## Start daemon with startproc(8). If this fails ## the return value is set appropriately by startproc. - if test -z "$SVNSERVE_USERID" || ! (/usr/bin/id $SVNSERVE_USERID &>/dev/null) \ + UID_ENT="$(/usr/bin/getent passwd $SVNSERVE_USERID)" + GID_ENT="$(/usr/bin/getent group $SVNSERVE_GROUPID)" - test -z "$SVNSERVE_GROUPID" || ! (/usr/bin/id $SVNSERVE_GROUPID &>/dev/null); - then - echo "User $SVNSERVE_USERID does not exist." - echo "Please check $SVNSERVE_CONFIG before starting this service." - rc_failed - else - startproc -u "$SVNSERVE_USERID" -g "$SVNSERVE_GROUPID" -e $SVNSERVE_BIN $SVNSERVE_OPTIONS - fi - # Remember status and be verbose + if test -z "$SVNSERVE_USERID" -o -z "$UID_ENT" + then + echo + echo "User $SVNSERVE_USERID does not exist." + echo "Please check $SVNSERVE_CONFIG before starting this service." + rc_failed + elif test -z "$SVNSERVE_GROUPID" -o -z "$GID_ENT" + then + echo + echo "Group $SVNSERVE_GROUPID does not exist." + echo "Please check $SVNSERVE_CONFIG before starting this service." + rc_failed + else + startproc -u "$SVNSERVE_USERID" -g "$SVNSERVE_GROUPID" -e $SVNSERVE_BIN $SVNSERVE_OPTIONS + fi + # Remember status and be verbose rc_status -v ;; stop)