You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 1.8.8 of the sudo utility the description of the -S flag was changed from "causes sudo to read the password from the standard input instead of the terminal device" to "write the prompt to the standard error and read the password from the standard input instead of using the terminal device" (emphasis mine), which is documented at https://www.sudo.ws/man.html between the man pages for those two versions.
Inside the SudoHelper class, a listener to the effect of when(partial: prompt, from: standardOutput) exists to wait for the sudo command to present a prompt asking the user for a password. Since it listens on stdout, but modern sudo writes that prompt to stderr, the listener will hang forever until terminated.
Writing a bytecode patch to the groovy ssh library that changed nothing except replacing that occurrence of standardOutput with standardError allowed sudo executions to proceed perfectly on every machine I had available to me to test.
Environment info
groovy-ssh-2.10.1
java_1.8.0_242-8u242-b08-0ubuntu3~18.04-b08
First encountered on Ubuntu kernel 4.15.0-76, later verified on a variety of linux machines
Steps to reproduce
connect to a machine with a version of sudo newer than 1.8.7 using username/password authentication
attempt to execute a command as sudo
The text was updated successfully, but these errors were encountered:
notfoundry
changed the title
SudoHelper broken for sudo versions newer than 1.8.7 (released 2014)
SudoHelper broken for sudo versions newer than 1.8.7 (released 2013)
Apr 23, 2020
In version 1.8.8 of the sudo utility the description of the -S flag was changed from "causes sudo to read the password from the standard input instead of the terminal device" to "write the prompt to the standard error and read the password from the standard input instead of using the terminal device" (emphasis mine), which is documented at https://www.sudo.ws/man.html between the man pages for those two versions.
Inside the SudoHelper class, a listener to the effect of
when(partial: prompt, from: standardOutput)
exists to wait for the sudo command to present a prompt asking the user for a password. Since it listens on stdout, but modern sudo writes that prompt to stderr, the listener will hang forever until terminated.Writing a bytecode patch to the groovy ssh library that changed nothing except replacing that occurrence of
standardOutput
withstandardError
allowed sudo executions to proceed perfectly on every machine I had available to me to test.Environment info
groovy-ssh-2.10.1
java_1.8.0_242-8u242-b08-0ubuntu3~18.04-b08
First encountered on Ubuntu kernel 4.15.0-76, later verified on a variety of linux machines
Steps to reproduce
The text was updated successfully, but these errors were encountered: