File tree Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Expand file tree Collapse file tree 1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,7 @@ function sanity_check_arguments {
141141 usage
142142 exit 0
143143 elif first_argument_is_sudo " $@ " ; then
144- OSCAP_SUDO=" sudo"
144+ OSCAP_SUDO=( " sudo" )
145145 # force pseudo-tty allocation so that users can type their password if necessary
146146 SSH_TTY_ALLOCATION_OPTION=" -t"
147147 shift
@@ -175,7 +175,7 @@ hash scp 2> /dev/null || die "Cannot find scp, please install the OpenSSH client
175175hash mktemp 2> /dev/null || die " Cannot find mktemp, please install coreutils."
176176
177177
178- OSCAP_SUDO=" "
178+ OSCAP_SUDO=()
179179# SSH_ADDITIONAL_OPTIONS may be defined in the calling shell
180180SSH_TTY_ALLOCATION_OPTION=" "
181181
@@ -303,11 +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- if [ -z " $OSCAP_SUDO " ]; then
307- ssh_execute_with_command_and_options " cd $REMOTE_TEMP_DIR ; oscap $( command_array_to_string " ${oscap_args[@]} " ) " " $SSH_TTY_ALLOCATION_OPTION "
308- else
309- 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 "
310- fi
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 "
311307OSCAP_EXIT_CODE=$?
312308echo " oscap exit code: $OSCAP_EXIT_CODE "
313309
You can’t perform that action at this time.
0 commit comments