summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2013-03-09 18:00:50 +0100
committerJonas Smedegaard <dr@jones.dk>2013-03-13 13:19:59 +0100
commitb6d2d8da1a502b86b8aef50dc885cdce27fdf595 (patch)
tree9f5329ed7baa35dd102573a4e71faedd9f3e1269
parent1110201eddb377e0b900f6f9f8de93fcddfde1a3 (diff)
Optimize to not spawn subshell in su-wrapper when running as same user.
-rwxr-xr-xsrc/share/common4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/share/common b/src/share/common
index 78fb04e..9329ce4 100755
--- a/src/share/common
+++ b/src/share/common
@@ -106,9 +106,9 @@ su_monkeysphere_user() {
local CMDLINE="$(perl -0 -e "foreach (@ARGV) {s/'/'\\\\''/g; print \"'\$_' \"}" "$@")"
case $(id -un) in
- # if monkeysphere user, run the command under bash
+ # if monkeysphere user, simply execute in current shell
"$MONKEYSPHERE_USER")
- bash -c "$CMDLINE"
+ "$@"
;;
# if root, su command as monkeysphere user