From: Michael Giroux <mlgiroux@gm...> - 2010-06-01 16:40:02
I'm trying to write an app that will change my password on several
Solaris systems. The application is based on the Shell example. I
provide an implementation of InputStream that feeds a simple sequence
to change the password. ex. "passwd\noldpwd\nnewpwd\nnewpwd\n".
The program appears to feed all of the input into the connection
before the system issues the first prompt. The Solaris system appears
to detect the 'passwd' command, but then seems to flush any input and
issues a new read. Consequently the responses provided by the script
are never seen.
Based on my guess that passwd is flushing the input stream and
prompting for input, I need to figure out how to synchronize the
feeding of input from my implementation of InputStream with the output
that is being generated by the server.
Note that the program works perfectly fine if I use System.in because
I am able to manually pace the delivery of input from the keyboard.
The problem is how to watch the output from Solaris and throttle the
Any pointers to existing examples, or specific advice will be appreciated.
+-From: Michael Giroux <mlgiroux@...> --
|_Date: Tue, 1 Jun 2010 09:39:56 -0700 _______
|Based on my guess that passwd is flushing the input stream and
|prompting for input, I need to figure out how to synchronize the
|feeding of input from my implementation of InputStream with the output
|that is being generated by the server.
I have not tried it by myself, but is it enough to wait for the prompt
like "password:" from the output that is being generated by the server?
1-14-20 HONCHO AOBA-KU,
SENDAI, MIYAGI 980-0014 Japan.
Get latest updates about Open Source Projects, Conferences and News.