From 91c8e62da5c7f06fe3e8aee4e612efb07b5d351e Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 13 Mar 2024 08:35:24 -0400 Subject: [PATCH] refactor: reparse the original ssh command in the hopes of keeping array arguments in place --- dokku | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/dokku b/dokku index 8d72d24c4..59cdd93f9 100755 --- a/dokku +++ b/dokku @@ -107,19 +107,12 @@ fi if [[ -n "$SSH_ORIGINAL_COMMAND" ]]; then export -n SSH_ORIGINAL_COMMAND exit_code=0 - if [[ $1 =~ git-* ]] || [[ $1 =~ git:* ]]; then - set -f - $0 $SSH_ORIGINAL_COMMAND - exit_code=$? - set +f - exit $? - else - set -f - xargs $0 <<<$SSH_ORIGINAL_COMMAND - exit_code=$? - set +f - exit $exit_code - fi + readarray -t -O "${#ssh_arg_array[@]}" ssh_arg_array < <( printf '%s' "$SSH_ORIGINAL_COMMAND" | xargs -n 1 ) + set -f + $O "${ssh_arg_array[@]}" + exit_code=$? + set +f + exit $exit_code fi if ! dokku_auth "$@"; then