Bug 322 - Redirecting sudo password to sudo command is not working
Redirecting sudo password to sudo command is not working
Status: RESOLVED INVALID
Product: Sudo
Classification: Unclassified
Component: Sudo
1.7.0
PC Linux
: low normal
Assigned To: Todd C. Miller
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-13 02:02 MST by Mariam
Modified: 2008-12-13 07:29 MST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mariam 2008-12-13 02:02:26 MST
Using echo command to redirect sudo password to sudo command is not working. Specifically, doing the following e.g is not working:

$(echo $password)|sudo touch /opt/try.txt

The sudo command is not responding to the redirection; just waiting for the input from the user regardless of the redirection.

The application should accept the redirection and create the file.

The bug is encountered under:
Sudo version 1.6.9p10 on OS linux ubuntu 2.6.24-19-generic
Comment 1 Todd C. Miller 2008-12-13 07:29:20 MST
sudo has to read the password directly from the tty device in order to be able to disable echo.  If you want to pass it in via standard input you need to use sudo's -S flag.