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
die 1 "target_user '${target_user}' does not exist!"
4064
+
fi
4065
+
4062
4066
if [ "${sucmd}"!='sudo' ];then
4063
4067
log warn "Privilege escalation utilities other than 'sudo' for installing to an alternate user account or running under account 'sysmaint' is untested."
true"$0: INFO: $package_name is not installed, ok."
291
292
return 1
292
293
}
293
-
294
-
if [ "${BASH_SOURCE}"="${0}" ];then
295
-
## Script was executed.
296
-
## This is useful to allow non-Bash shell scripts to use this functionality.
297
-
set -o errexit
298
-
set -o nounset
299
-
set -o errtrace
300
-
set -o pipefail
301
-
pkg_installed "$1"
302
-
fi
303
-
##### END pasted by build-dist-installer-cli from file /usr/libexec/helper-scripts/package_installed_check.bsh
294
+
##### END pasted by build-dist-installer-cli from file /usr/libexec/helper-scripts/package_installed_check.sh
304
295
305
296
########################
306
297
## END DEFAULT VALUES ##
@@ -462,7 +453,7 @@ test_run_as_target_user() {
462
453
## root_output would catch xtrace and hence variable root_output would be non-empty.
463
454
## Therefore disabling xtrace.
464
455
disable_xtrace
465
-
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)"
466
457
re_enable_xtrace_maybe
467
458
iftest -n "${root_output}";then
468
459
die 1 "${underline}run_as_target_user:${nounderline} 'sudo -u ${target_user}' test produced unexpected output: '${root_output}'"
@@ -1029,6 +1020,9 @@ disable_xtrace() {
1029
1020
}
1030
1021
1031
1022
re_enable_xtrace_maybe() {
1023
+
if [ "${xtrace_force_no_re_enable:-}"="true" ];then
1024
+
return 0
1025
+
fi
1032
1026
iftest"${xtrace:-}" = "1";then
1033
1027
set -o xtrace
1034
1028
fi
@@ -4891,6 +4885,10 @@ set_default() {
4891
4885
set_target_user_account() {
4892
4886
target_user="${1:-}"
4893
4887
4888
+
if! id --user -- "${target_user}">/dev/null;then
4889
+
die 1 "target_user '${target_user}' does not exist!"
4890
+
fi
4891
+
4894
4892
if [ "${sucmd}"!='sudo' ];then
4895
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