In a script, when a command starts with sudo , the next command starts almost immediately
To visualize the problem, run-as-spot this script
Code: Select all
#!/bin/bash
sudo mkdir /testsudo
touch /testsudo/test
The command touch fails (unless you enter the password very quickly)
Another bug, less important, is with the option "no future required in the future" (EDIT : the option is not the problem, see the third post)
If we enter
Code: Select all
run-as-spot sudo mkdir /test
and tick for the option (after typing the correct password), an entry
bash:/bin/mkdir
is created in /root/.sudo-sh-allow
If we re-enter the command, no more popup window asking the password
But if we enter
Code: Select all
run-as-spot sudo /bin/mkdir /test
and tick for the option, the created entry is
bash:/bin/busybox
(/usr/bin/mkdir is a link to /usr/bin/busybox)
And the password is still asked if we re-enter the command (EDIT : I got a different result in another test)
EDIT:
Another bug
If we enter a wrong password, the command is not executed but if we click on OK without entering anything, the command is executed !
EDIT2 (for the EDIT)
line 92 of /usr/bin/sudo.sh
rootHASH="$(busybox cryptpw -m SHA512 -S ${rootSALT} ${rootPW})"
if no password is entered, then rootPW=""
We need a test, just before this line, to verify that rootPW is no an empty variable (new EDIT: or initializing rootPW, line 54, by a value not empty but differnet of the root password)
EDIT : correction of a important error. I had forgotten the sudo in code line