Merge pull request #4333 from dokku/3149-respect-tmpdir
Drop tmpdir environment variables when not running as dokku user
This commit is contained in:
1 file changed
+7
-4
@@ -88,10 +88,13 @@ if [[ "${args[0]}" =~ ^--.* ]]; then
|
|||||||
fi
|
fi
|
||||||
! has_tty && DOKKU_QUIET_OUTPUT=1
|
! has_tty && DOKKU_QUIET_OUTPUT=1
|
||||||
|
|
||||||
if [[ $(id -un) != "dokku" ]] && [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
if [[ $(id -un) != "dokku" ]]; then
|
||||||
export SSH_USER=$(id -un)
|
unset TMP TMPDIR TEMP TEMPDIR
|
||||||
sudo -u dokku -E -H "$0" "$@"
|
if [[ ! $1 =~ plugin:* ]] && [[ $1 != "ssh-keys:add" ]] && [[ $1 != "ssh-keys:remove" ]]; then
|
||||||
exit $?
|
export SSH_USER=$(id -un)
|
||||||
|
sudo -u dokku -E -H "$0" "$@"
|
||||||
|
exit $?
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]] || [[ $1 == "ssh-keys:remove" ]]; then
|
if [[ $1 =~ ^plugin:.* && $1 != "plugin:help" && $1 != "plugin:list" ]] || [[ $1 == "ssh-keys:add" ]] || [[ $1 == "ssh-keys:remove" ]]; then
|
||||||
|
|||||||
Reference in new issue
Block a user