Skip to content

Commit b8a9e03

Browse files
committed
build
1 parent 78ea074 commit b8a9e03

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

usr/share/usability-misc/dist-installer-cli-standalone

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,10 +410,12 @@ get_su_cmd(){
410410

411411
test_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

0 commit comments

Comments
 (0)