Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/processone/ejabberd.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHolger Weiss <holger@zedat.fu-berlin.de>2014-07-27 13:21:55 +0400
committerHolger Weiss <holger@zedat.fu-berlin.de>2014-07-27 13:21:55 +0400
commit3e232952ea587a4d4c42e37f1a3dbdc3c5750b41 (patch)
tree5e72e668fbfcc182713b3f46b5ce32f3829ab115 /ejabberdctl.template
parentc0001184fde3b4d2e3768d19c59440e9c9ef01c5 (diff)
ejabberdctl: Omit su(1)'s "-p" flag
On Linux, su(1)'s "-p" flag makes sure the following environment variables are preserved: $HOME, $SHELL, $USER, and $LOGNAME. The flag isn't portable, and since we don't set HOME=$SPOOLDIR anymore, there's no reason to preserve these variables anyway. Without "-p", we also don't need to set HOME=$INSTALLUSER_HOME, as su(1) now does that for us.
Diffstat (limited to 'ejabberdctl.template')
-rwxr-xr-xejabberdctl.template8
1 files changed, 2 insertions, 6 deletions
diff --git a/ejabberdctl.template b/ejabberdctl.template
index 204d22509..4e8234c99 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -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