aboutsummaryrefslogtreecommitdiff
path: root/kiss
diff options
context:
space:
mode:
authordylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-30 08:47:10 +0000
committerdylan.araps@gmail.com <dylan.araps@gmail.com>2020-01-30 08:47:10 +0000
commit5fa575ed4cb03cbe3185e196ebe46ad9dbebf29d (patch)
tree11e45d1fc3c03caeb1a5f4db6329b04dd8bd7dc6 /kiss
parentadcdd7185bced7de061e9fe15b5f7d1f17610cff (diff)
downloadcpt-5fa575ed4cb03cbe3185e196ebe46ad9dbebf29d.tar.gz
kiss: cleaneer as_root
FossilOrigin-Name: a4c268cb034f7f33ff61df8e86b62770e650abfe13174858c4066c4e859978d9
Diffstat (limited to 'kiss')
-rwxr-xr-xkiss8
1 files changed, 4 insertions, 4 deletions
diff --git a/kiss b/kiss
index c5c10ff..35816db 100755
--- a/kiss
+++ b/kiss
@@ -53,9 +53,9 @@ as_root() {
log "Using '${su:-su}'"
case $su in
- *sudo) sudo -E KISS_FORCE="$KISS_FORCE" "$@" ;;
- *doas) KISS_FORCE="$KISS_FORCE" doas "$@" ;;
- *) su -pc "KISS_FORCE=$KISS_FORCE $* <&3" 3<&0 </dev/tty ;;
+ *sudo) sudo -u "${user:-root}" -E "$@" ;;
+ *doas) doas -u "${user:-root}" "$@" ;;
+ *) su -pc "$* <&3" "${user:-root}" 3<&0 </dev/tty ;;
esac
exit
@@ -1165,7 +1165,7 @@ args() {
# Rerun the script with 'su' if the user isn't root.
# Cheeky but 'su' can't be used on shell functions themselves.
- as_root kiss "$action" "$@"
+ KISS_FORCE="$KISS_FORCE" as_root kiss "$action" "$@"
;;
esac