summaryrefslogtreecommitdiffstats
path: root/ejabberd-0005-Use-bin-sh-as-the-explicit-shell-when-using-su-in-ej.patch
blob: 3f669b436d80633a204f95bb8ad5e91b96ad169d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
From 12d9d97baaff3bc4bd4910647f5de3378be0cf6e Mon Sep 17 00:00:00 2001
From: Randy Barlow <randy@electronsweatshop.com>
Date: Sun, 10 Dec 2017 12:52:22 -0500
Subject: [PATCH] Use /bin/sh as the explicit shell when using su in
 ejabberdctl.

Some distributions (such as Fedora) use /sbin/nologin as the login
shell for the ejabberd user. The newer version of ejabberdctl uses
su to perform the command if the INSTALLUSER invokes the script.
This commit adjusts the call to su so that it passes /bin/sh as
the shell to use so that it will work correctly when the ejabberd
user's shell is set to nologin.

Signed-off-by: Randy Barlow <randy@electronsweatshop.com>
---
 ejabberdctl.template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ejabberdctl.template b/ejabberdctl.template
index 83637766..571b90b6 100755
--- a/ejabberdctl.template
+++ b/ejabberdctl.template
@@ -110,7 +110,7 @@ export ERL_LIBS
 exec_cmd()
 {
     case $EXEC_CMD in
-        as_install_user) su -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
+        as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;;
         as_current_user) "$@" ;;
     esac
 }
-- 
2.14.3