I have been facing inconsistent behaviour between two versions of sudo for the following scenario:
$ sudo sleep 5
echo "hi" # during the 5 seconds
On one system, with sudo version 1.8.21p2
, this buffers the second command and runs it afterwards -- but on a newer version (1.9.9
), it doesn't:
$ sudo --version
Sudo version 1.9.9
...
$ sudo sleep 5
echo 'hi'
$
$ sudo --version
Sudo version 1.8.21p2
...
$ sudo sleep 5
echo 'hi'
$ echo 'hi'
hi
I found this bug which is relevant: https://bugzilla.sudo.ws/show_bug.cgi?id=786, however the discussion there suggests that this was fixed in version 1.8.20. Has it possibly been reintroduced between 1.8.20 and 1.9.9? If so, what could be a workaround?
Edit: to clarify, both of those were run after running a sudo
command and providing the user password
CodePudding user response:
In Ubuntu 22.04, the use_pty
option is on in supplied /etc/sudoers
file, which has this effect.