From 42e3250ad67024e21cfb2d79b43cc6eb49489081 Mon Sep 17 00:00:00 2001 From: mleo2003 Date: Wed, 3 Jan 2024 19:37:01 -0800 Subject: [PATCH] Update ssh-copy.sh RUN-839: Fix: rd_secure_passphrase: invalid indirect expansion (for ssh-copy.sh as well) --- contents/ssh-copy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contents/ssh-copy.sh b/contents/ssh-copy.sh index 9f05025..3221fb6 100755 --- a/contents/ssh-copy.sh +++ b/contents/ssh-copy.sh @@ -90,7 +90,7 @@ if [[ "privatekey" == "$authentication" ]] ; then fi RUNSCP="scp $SSHOPTS $FILE $USER@$HOST:$DIR" - if [[ -n "${!rd_secure_passphrase}" ]]; then + if [[ -n $rd_secure_passphrase ]] && [[ -n "${!rd_secure_passphrase}" ]]; then mkdir -p "/tmp/.ssh-exec" SSH_KEY_PASSPHRASE_STORAGE_PATH=$(mktemp "/tmp/.ssh-exec/ssh-passfile.$USER@$HOST.XXXXX") echo "${!rd_secure_passphrase}" > "$SSH_KEY_PASSPHRASE_STORAGE_PATH" @@ -117,7 +117,7 @@ if [[ "password" == "$authentication" ]] ; then mkdir -p "/tmp/.ssh-exec" SSH_PASS_STORAGE_PATH=$(mktemp "/tmp/.ssh-exec/ssh-passfile.$USER@$HOST.XXXXX") - if [[ -n "${!rd_secure_password}" ]]; then + if [[ -n $rd_secure_password ]] && [[ -n "${!rd_secure_password}" ]]; then echo "${!rd_secure_password}" > "$SSH_PASS_STORAGE_PATH" else echo "$RD_CONFIG_SSH_PASSWORD_STORAGE_PATH" > "$SSH_PASS_STORAGE_PATH"