mirror of
https://codeberg.org/kiss-community/kiss
synced 2024-09-28 12:22:39 -06:00
kiss: Clean up as_root()
This commit is contained in:
parent
b0a460fcf6
commit
a39e9d2410
7
kiss
7
kiss
@ -56,10 +56,9 @@ as_root() {
|
||||
[ "$uid" = 0 ] || log "Using '${su:-su}' (to become ${user:=root})"
|
||||
|
||||
case ${su##*/} in
|
||||
sudo) sudo -u "$user" -- env "$@" ;;
|
||||
doas) doas -u "$user" -- env "$@" ;;
|
||||
su) su -c "env $* <&3" "$user" 3<&0 </dev/tty ;;
|
||||
*) die "Invalid KISS_SU value: $su (valid: doas, sudo, su)"
|
||||
doas|sudo) "$su" -u "$user" -- env "$@" ;;
|
||||
su) "$su" -c "env $* <&3" "$user" 3<&0 </dev/tty ;;
|
||||
*) die "Invalid KISS_SU value: $su (valid: doas, sudo, su)"
|
||||
esac
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user