File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -410,10 +410,12 @@ get_su_cmd(){
410410
411411test_run_as_target_user () {
412412 local root_output
413- root_output=" $( run_as_target_user timeout --kill-after 5 5 test -d /usr 2>&1 ) "
413+ # # Catches xtrace and hence variable root_output would be non-empty.
414+ # root_output="$(run_as_target_user timeout --kill-after 5 5 test -d /usr 2>&1)"
415+ # # Therefore use a subshell and disable xtrace.
416+ root_output=" $( ( set +x; run_as_target_user timeout --kill-after 5 5 test -d /usr ) 2>&1 ) "
414417 if test -n " ${root_output} " ; then
415- log error " 'run_as_target_user' output: '${root_output} '"
416- die 1 " ${underline} run_as_target_user:${nounderline} Unexpected non-empty output for 'sudo -u ${target_user} ' test."
418+ die 1 " ${underline} run_as_target_user:${nounderline} 'sudo -u ${target_user} ' test produced unexpected output: '${root_output} '"
417419 fi
418420}
419421
You can’t perform that action at this time.
0 commit comments