From 70edfaf348640f923f6f6b73f9332c5cbdd8554e Mon Sep 17 00:00:00 2001 From: Nikolas Garofil Date: Wed, 22 Dec 2021 19:16:50 +0100 Subject: [PATCH] Fix(adduser): better binary check --- plugins/adduser/adduser.plugin.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/adduser/adduser.plugin.zsh b/plugins/adduser/adduser.plugin.zsh index 02dfb556b..6df23bc77 100644 --- a/plugins/adduser/adduser.plugin.zsh +++ b/plugins/adduser/adduser.plugin.zsh @@ -25,11 +25,11 @@ adduser() { chown ${@[$#]} $temp_installscript && chmod +x $temp_installscript #try installing with sudo or su when not available - if [[ -x $(which sudo) ]] ; then + if [[ -x "$commands[sudo]" ]] ; then sudo -u ${@[$#]} $temp_installscript returncode=$? else - if [[ -x $(which su) ]] ; then + if [[ -x "$commands[su]" ]] ; then su -l ${@[$#]} -c $temp_installscript returncode=$? else