Fix several problems with rbssh

Review Request #2105 — Created Feb. 6, 2011 and submitted — Latest diff uploaded


Review Board


This fixes several problems with rbssh on Windows and Linux.

rbssh had problems with some types of repositories. Mostly, they expected
certain command line options to be available that weren't. We now support
-q/--quiet, -s (for subsystem selection), and -V (print version).

In general, the rbssh code has been cleaned up to be a bit better structured
and less hacky. We have classes for Posix and Windows, rather than
individual functions. We also now tell OptionParser to leave behind any
unknown arguments so that we can pass them to the command to run on the
other server.

rbssh now supports a shell and sftp. If a valid key or password wasn't
available during authentication, we prompt for a new password. We do this
three times before giving up.

On Windows, the process was hanging around forever instead of properly
shutting down. We now let stdin processing drive in the main thread and
then, upon closing, we trigger a shutdown of the writer, which should
close the other end and shut down the process.

This also improves our logging situation by using the standard Python
logging module instead of our own debug() function.
With the other changes I have up, SSH worked on both Windows and Linux
for all supported types of repositories.