Systems whose prompt ends with a $ or # without a following space will have nothing to read when synch_original_prompt tries to execute a read_nonblocking (to clear the buffer). Thus, the read times out. The attached patch adds a sendline() before the attempted read, to ensure that the buffer has something in it.
This fix is important because the default prompt on Ubuntu 8.04 server edition does not have a space after the $/#. This causes pxssh to fail on login.
An alternative solution would be to tell read_nonblocking to look for empty buffers instead of timing out, but in this case it is difficult to distinguish between a read that is taking a long time and one where there is no data to send.
The attached patch also checks for EOF on login in case the connection was abruptly closed.
Log in to post a comment.