Skip to content

Commit 12732a5

Browse files
committed
fix: oscap-ssh: extend command_array_to_string coverage to sudo
This ensures whole command is quoted.
1 parent 1ea10eb commit 12732a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

utils/oscap-ssh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ echo "Starting the evaluation..."
303303
# changing directory because of --oval-results support. oval results files are
304304
# dumped into PWD, and we can't be sure by the file names - we need controlled
305305
# environment
306-
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"
306+
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"
307307
OSCAP_EXIT_CODE=$?
308308
echo "oscap exit code: $OSCAP_EXIT_CODE"
309309

0 commit comments

Comments
 (0)