aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2021-01-03 10:13:12 +0000
committermerakor <cem@ckyln.com>2021-01-03 10:13:12 +0000
commit5c56af98e95d12fd4531cd9197657eace1fe8bc1 (patch)
treeb5d466e6baf93b80cf352a6f4091f1db3072c188
parent9fb2e34d5e9120cdd7dcac9560bc8b383a86877c (diff)
downloadcpt-5c56af98e95d12fd4531cd9197657eace1fe8bc1.tar.gz
as_root(): add `sls` to accepted root tools
FossilOrigin-Name: ca05dfca6f8529b23647ddac4e9d7d3317c4508ee15045e60a4eac63787a04b7
-rw-r--r--src/cpt-lib.in6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cpt-lib.in b/src/cpt-lib.in
index 2af31fb..73e483c 100644
--- a/src/cpt-lib.in
+++ b/src/cpt-lib.in
@@ -389,7 +389,7 @@ as_root() {
"$@"
case ${su##*/} in
- sudo|doas) "$su" -u "$user" -- env "$@" ;;
+ sls|sudo|doas) "$su" -u "$user" -- env "$@" ;;
su) su -c "env $* <&3" "$user" 3<&0 </dev/tty ;;
*) die "Invalid CPT_SU value: $su" ;;
esac
@@ -1867,7 +1867,9 @@ create_cache() {
# Figure out which 'sudo' command to use based on the user's choice or
# what is available on the system.
- su=${CPT_SU:-$(command -v sudo || command -v doas)} || su=su
+ su=${CPT_SU:-$(command -v sls ||
+ command -v sudo ||
+ command -v doas)} || su=su
# Store the date and time of script invocation to be used as the name
# of the log files the package manager creates uring builds.