mirror of
https://github.com/Llewellynvdm/Tomb.git
synced 2024-11-22 04:25:12 +00:00
Validate user-supplied sudo alternative (in name only)
This commit is contained in:
parent
087ecd25a2
commit
ce521ed2e2
10
tomb
10
tomb
@ -113,7 +113,15 @@ export TEXTDOMAIN=tomb
|
||||
# Wrap sudo with a more visible message or apply user-supplied alternative to sudo
|
||||
_sudo() {
|
||||
if option_is_set --sudo; then
|
||||
$(option_value --sudo) ${@};
|
||||
case `basename $(option_value --sudo)` in
|
||||
"doas")
|
||||
$(option_value --sudo) ${@}
|
||||
;;
|
||||
*)
|
||||
_failure "Only doas is supported as sudo alternative"
|
||||
;;
|
||||
esac
|
||||
|
||||
else
|
||||
local msg="[sudo] Enter password for user ::1 user:: to gain superuser privileges"
|
||||
command -v gettext 1>/dev/null 2>/dev/null && msg="$(gettext -s "$msg")"
|
||||
|
Loading…
Reference in New Issue
Block a user