File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -280,7 +280,12 @@ echo "Starting the evaluation..."
280
280
# changing directory because of --oval-results support. oval results files are
281
281
# dumped into PWD, and we can't be sure by the file names - we need controlled
282
282
# environment
283
- ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; $OSCAP_SUDO oscap $( command_array_to_string oscap_args) " " $SSH_TTY_ALLOCATION_OPTION "
283
+ if [ -z " $OSCAP_SUDO " ]; then
284
+ ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; oscap $( command_array_to_string oscap_args) " " $SSH_TTY_ALLOCATION_OPTION "
285
+ else
286
+ OSCAP_CMD=" oscap $( command_array_to_string oscap_args) ; rc=\$ ?; chown \$ SUDO_USER $REMOTE_TEMP_DIR /*; exit \$ rc"
287
+ ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; $OSCAP_SUDO sh -c '$OSCAP_CMD '" " $SSH_TTY_ALLOCATION_OPTION "
288
+ fi
284
289
OSCAP_EXIT_CODE=$?
285
290
echo " oscap exit code: $OSCAP_EXIT_CODE "
286
291
You can’t perform that action at this time.
0 commit comments