From 82cd0adb79233e134db60e9b6d7a2acbdaaaf888 Mon Sep 17 00:00:00 2001 From: Badlop Date: Tue, 12 Jan 2010 18:13:30 +0000 Subject: [PATCH] Check for Effective GID EGID in ejabberdctl (thanks to Rustam Aliyev)(EJAB-1160) SVN Revision: 2894 --- src/ejabberdctl.template | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ejabberdctl.template b/src/ejabberdctl.template index 00152d9fd..0b7c7d1bc 100644 --- a/src/ejabberdctl.template +++ b/src/ejabberdctl.template @@ -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