Skip to content

Commit a9026f3

Browse files
committed
fix: oscap-ssh: ensure cd is done
Fail if can not cd into a directory. Shellcheck would warn about this.
1 parent 0550108 commit a9026f3

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; 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; ${OSCAP_SUDO[@]} scap $(command_array_to_string "${oscap_args[@]}")" "$SSH_TTY_ALLOCATION_OPTION"
307307
OSCAP_EXIT_CODE=$?
308308
echo "oscap exit code: $OSCAP_EXIT_CODE"
309309

0 commit comments

Comments
 (0)