25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-24 16:23:40 +01:00

Merge pull request #264 from weiss/su-without-p

ejabberdctl: Omit su(1)'s "-p" flag
This commit is contained in:
Evgeny Khramtsov 2014-07-28 11:06:27 +04:00
commit 58fd56e6a2

View File

@ -23,15 +23,11 @@ if [ "$INSTALLUSER" != "" ] ; then
for GID in `id -G`; do
if [ $GID -eq 0 ] ; then
INSTALLUSER_HOME=$(getent passwd "$INSTALLUSER" | cut -d: -f6)
if [ -z "$INSTALLUSER_HOME" ] ; then
echo "Cannot determine home directory of $INSTALLUSER" >&2
exit 1
fi
if [ ! -d "$INSTALLUSER_HOME" ] ; then
if [ -n "$INSTALLUSER_HOME" ] && [ ! -d "$INSTALLUSER_HOME" ] ; then
mkdir -p "$INSTALLUSER_HOME"
chown "$INSTALLUSER" "$INSTALLUSER_HOME"
fi
EXEC_CMD="env HOME=$INSTALLUSER_HOME su $INSTALLUSER -p -c"
EXEC_CMD="su $INSTALLUSER -c"
fi
done
if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then