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 @@ -284,7 +284,12 @@ echo "Starting the evaluation..."
284
284
# changing directory because of --oval-results support. oval results files are
285
285
# dumped into PWD, and we can't be sure by the file names - we need controlled
286
286
# environment
287
- ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; $OSCAP_SUDO oscap $( command_array_to_string oscap_args) " " $SSH_TTY_ALLOCATION_OPTION "
287
+ if [ -z " $OSCAP_SUDO " ]; then
288
+ ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; oscap $( command_array_to_string oscap_args) " " $SSH_TTY_ALLOCATION_OPTION "
289
+ else
290
+ OSCAP_CMD=" oscap $( command_array_to_string oscap_args) ; rc=\$ ?; chown \$ SUDO_USER $REMOTE_TEMP_DIR /*; exit \$ rc"
291
+ ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; $OSCAP_SUDO sh -c '$OSCAP_CMD '" " $SSH_TTY_ALLOCATION_OPTION "
292
+ fi
288
293
OSCAP_EXIT_CODE=$?
289
294
echo " oscap exit code: $OSCAP_EXIT_CODE "
290
295
You can’t perform that action at this time.
0 commit comments