You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: usr/share/usability-misc/dist-installer-cli-standalone
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -453,7 +453,7 @@ test_run_as_target_user() {
453
453
## root_output would catch xtrace and hence variable root_output would be non-empty.
454
454
## Therefore disabling xtrace.
455
455
disable_xtrace
456
-
root_output="$(run_as_target_user timeout --kill-after 5 5 test -d /usr 2>&1)"
456
+
xtrace_force_no_re_enable=true root_output="$(run_as_target_user timeout --kill-after 5 5 test -d /usr 2>&1)"
457
457
re_enable_xtrace_maybe
458
458
iftest -n "${root_output}";then
459
459
die 1 "${underline}run_as_target_user:${nounderline} 'sudo -u ${target_user}' test produced unexpected output: '${root_output}'"
@@ -1020,6 +1020,9 @@ disable_xtrace() {
1020
1020
}
1021
1021
1022
1022
re_enable_xtrace_maybe() {
1023
+
if [ "${xtrace_force_no_re_enable:-}"="true" ];then
1024
+
return 0
1025
+
fi
1023
1026
iftest"${xtrace:-}" = "1";then
1024
1027
set -o xtrace
1025
1028
fi
@@ -4882,6 +4885,10 @@ set_default() {
4882
4885
set_target_user_account() {
4883
4886
target_user="${1:-}"
4884
4887
4888
+
if! id --user -- "${target_user}">/dev/null;then
4889
+
die 1 "target_user '${target_user}' does not exist!"
4890
+
fi
4891
+
4885
4892
if [ "${sucmd}"!='sudo' ];then
4886
4893
log warn "Privilege escalation utilities other than 'sudo' for installing to an alternate user account or running under account 'sysmaint' is untested."
0 commit comments