From: Ian Kelling Date: Tue, 2 Jul 2024 17:35:04 +0000 (-0400) Subject: bug fix. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=ansible-inputs.git bug fix. --- diff --git a/roles/kvmhost/files/simple/usr/local/bin/savannah-virsh b/roles/kvmhost/files/simple/usr/local/bin/savannah-virsh index 5d0471d..fb8e3e5 100755 --- a/roles/kvmhost/files/simple/usr/local/bin/savannah-virsh +++ b/roles/kvmhost/files/simple/usr/local/bin/savannah-virsh @@ -32,13 +32,16 @@ regex='^[a-z0-9. ]*$' # restricted ssh does not allow arguments, but they exist in this env variable. # The var comes with a leading space, remove it. -args="${SSH_ORIGINAL_COMMAND#* }" +args="${SSH_ORIGINAL_COMMAND# }" if [[ ! $args =~ $regex ]]; then echo "error: bad argument. args=$args" >&2; exit 1 fi -arg1="${args%% *}" +IFS=" " read -r -a arg_array <<<"$args" + + +arg1="${arg_array[0]}" case "$arg1" in list) @@ -51,8 +54,7 @@ case "$arg1" in ;; esac -# just 2 args, so split the space. -arg2="${args## *}" +arg2="${arg_array[1]}" case "$arg2" in