dsk-wz.sh script return false for execpt four command
in the script
case $command in parted) executor $command $arguments; ;; mkfs.*) executor $command $arguments; ;; lsblk) executor $command $arguments; ;; fdisk) executor $command $arguments; ;; *) # if a command is not one we know, we exit with an error echo "Sorry, command $command is not known"; exit -1; ;; esac
so it return false for all other command
#1 Updated by tmkasun almost 6 years ago
I don't think it is a bug , but an additional safety feature to prevent executing unwanted , or unintended shell commands through the rails library1,You can always add new commands to here and allow it to execute through rails library, there won't be any restriction to that.
And why to have such safety mechanism is , this file(dsk-wz.sh) is created on-the fly(by install script) when the app is installed on the HDA,and it is placed in the elevated. so that it can execute commands with super user permission without asking for password(echo 'Defaults !requiretty' > /etc/sudoers.d/disk_wizard).So to prevent any unwanted actions, we filter out the commands only only allow those command to be executed through the script.
BTW , thta case statement is more compact now
case $command in parted|mkfs.*|lsblk|fdisk|mount|umount|kill|df|mkdir|blkid|multipath|udevadm|partprobe) executor $command $arguments; ;;
Also available in: Atom