From 33368b7e5cca1600e908e1f780595abea840ca7d Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Jul 2014 15:15:00 +0200 Subject: [PATCH 1/5] doc/Makefile: Don't insist on using /bin/bash Fix "make doc" for systems that don't have /bin/bash. There's no bash-specific code in doc/Makefile anymore. --- doc/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/Makefile b/doc/Makefile index db378be67..a67148798 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,6 +1,6 @@ # $Id$ -SHELL = /bin/bash +SHELL = /bin/sh CONTRIBUTED_MODULES = "" #ifeq ($(shell ls mod_http_bind.tex),mod_http_bind.tex) From 43000d9ce4148a4b33e31ee217b11d8643fcb2b0 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Jul 2014 15:25:28 +0200 Subject: [PATCH 2/5] ejabberdctl: Use $INSTALLUSER's home directory Make sure ejabberdctl uses the $INSTALLUSER's .erlang.cookie file even if the script was executed by root. --- ejabberdctl.template | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ejabberdctl.template b/ejabberdctl.template index a86694f67..b9f372514 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -22,7 +22,8 @@ if [ "$INSTALLUSER" != "" ] ; then EXEC_CMD="false" for GID in `id -G`; do if [ $GID -eq 0 ] ; then - EXEC_CMD="su $INSTALLUSER -p -c" + INSTALLUSER_HOME=$(getent passwd "$INSTALLUSER" | cut -d: -f6) + EXEC_CMD="env HOME=$INSTALLUSER_HOME su $INSTALLUSER -p -c" fi done if [ `id -g` -eq `id -g $INSTALLUSER` ] ; then From 46f01b962ae51d402dd564937aa69d631a21de66 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Jul 2014 17:16:47 +0200 Subject: [PATCH 3/5] ejabberdctl: Create home directory as root If the $INSTALLUSER is not root, he will usually not have the necessary permissions to create his home directory. --- ejabberdctl.template | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ejabberdctl.template b/ejabberdctl.template index b9f372514..a4d4680e2 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -23,6 +23,14 @@ 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 + mkdir -p "$INSTALLUSER_HOME" + chown "$INSTALLUSER" "$INSTALLUSER_HOME" + fi EXEC_CMD="env HOME=$INSTALLUSER_HOME su $INSTALLUSER -p -c" fi done @@ -143,10 +151,6 @@ fi [ -z "$date" ] || EJABBERD_OPTS="${EJABBERD_OPTS} log_rotate_date '$date'" [ -z "$EJABBERD_OPTS" ] || EJABBERD_OPTS="-ejabberd ${EJABBERD_OPTS}" -# create the ejabberd home dir with the proper user if doesn't exist -# then change to that directory readable by INSTALLUSER to -# prevent "File operation error: eacces." messages -[ -d $HOME ] || $EXEC_CMD "mkdir -p $HOME" [ -d $SPOOL_DIR ] || $EXEC_CMD "mkdir -p $SPOOL_DIR" # then set SPOOL_DIR as ejabberd home directory by changing # to that directory readable by INSTALLUSER to prevent From 9c279f2e0609f1b8576f3ac6890cde87a997e931 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Jul 2014 17:20:09 +0200 Subject: [PATCH 4/5] ejabberdctl: Remove outdated comment The home directory is no longer set to $SPOOL_DIR. --- ejabberdctl.template | 3 --- 1 file changed, 3 deletions(-) diff --git a/ejabberdctl.template b/ejabberdctl.template index a4d4680e2..204d22509 100755 --- a/ejabberdctl.template +++ b/ejabberdctl.template @@ -152,9 +152,6 @@ fi [ -z "$EJABBERD_OPTS" ] || EJABBERD_OPTS="-ejabberd ${EJABBERD_OPTS}" [ -d $SPOOL_DIR ] || $EXEC_CMD "mkdir -p $SPOOL_DIR" -# then set SPOOL_DIR as ejabberd home directory by changing -# to that directory readable by INSTALLUSER to prevent -# "File operation error: eacces." messages cd $SPOOL_DIR # export global variables From b997c4325a9f7e23e7029ef8dd882aacecfd6613 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Thu, 24 Jul 2014 17:50:43 +0200 Subject: [PATCH 5/5] Let Git ignore the "configure" script --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d1418f9b0..94d456ef8 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ /Makefile /config.log /config.status +/configure /aclocal.m4 /contrib/extract_translations/extract_translations.beam /*.cache