Skip to content

Commit

Permalink
fix: oscap-ssh: extend command_array_to_string coverage to sudo
Browse files Browse the repository at this point in the history
This ensures whole command is quoted.
  • Loading branch information
maage committed Aug 21, 2022
1 parent 1ea10eb commit 12732a5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion utils/oscap-ssh
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ echo "Starting the evaluation..."
# changing directory because of --oval-results support. oval results files are
# dumped into PWD, and we can't be sure by the file names - we need controlled
# environment
ssh_execute_with_command_and_options "cd $REMOTE_TEMP_DIR || exit 1; umask 022; ${OSCAP_SUDO[@]} scap $(command_array_to_string "${oscap_args[@]}")" "$SSH_TTY_ALLOCATION_OPTION"
ssh_execute_with_command_and_options "cd $REMOTE_TEMP_DIR || exit 1; umask 022; $(command_array_to_string "${OSCAP_SUDO[@]}" scap "${oscap_args[@]}")" "$SSH_TTY_ALLOCATION_OPTION"
OSCAP_EXIT_CODE=$?
echo "oscap exit code: $OSCAP_EXIT_CODE"

Expand Down

0 comments on commit 12732a5

Please sign in to comment.