25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-20 17:27:00 +01:00

Check for Effective GID EGID in ejabberdctl (thanks to Rustam Aliyev)(EJAB-1160)

SVN Revision: 2893
This commit is contained in:
Badlop 2010-01-12 17:50:21 +00:00
parent 7b76fdcde7
commit 4d85297c85

View File

@ -57,11 +57,14 @@ fi
# check the proper system user is used
ID=`id -g`
GIDS=`id -G`
EJID=`id -g $INSTALLUSER`
EXEC_CMD="false"
if [ $ID -eq 0 ] ; then
for GID in $GIDS; do
if [ $GID -eq 0 ] ; then
EXEC_CMD="su ${INSTALLUSER} -p -c"
fi
fi
done
if [ "$ID" -eq "$EJID" ] ; then
EXEC_CMD="sh -c"
fi