[sudo-users] Potential bug with sudo

Larry Becke llbecke at gmail.com
Fri Aug 9 10:32:14 MDT 2013

I've been doing some testing with streamed standard input to the sudo
command, and multiple sudo commands in a single command line...

if I do the following, it works just fine

ssh remotehost
echo ${passwd}" | sudo -S uname && sudo ls

if I do the following under sudo 1.6, it works just fine...
echo '${passwd}" | ssh remotehost "sudo -S uname -a && sudo ls"

if I do the following under sudo 1.7 or sudo 1.8 variants, it fails.
echo '${passwd}" | ssh remotehost "sudo -S uname -a && sudo ls"

Under the 1.7 and 1.8 variants it does a few things..

Even though I've specified that the password will come from standard input,
it displays the password prompt to the stdout.
Then the 2nd sudo command, even though the sudo ticket was just created and
is valid for use til it expires, errors out because there is no tty and no
askpass available.

sudo: no tty present and no askpass program specified

The problems that I see with this are..

1st - If using -S, no password prompt should be written to stdout.
2nd - If a valid sudo ticket is available, sudo should not check for stdin
or askpass programs.

Thank you for your time.

More information about the sudo-users mailing list