John R Mishanski Jr
2005-Dec-25 11:05 UTC
[Net-ssh-devel] Net::SSH - patch for ":interactive" option
Hello, I am working on a lightweight, ruby based server/service monitoring tool, and I am using Net::SSH to facilitate some remote checks. Let me first say thanks for all the hard work. I needed an additional option to Net::SSH.start, so I created the patch which is attached to this message. My monitoring tool may be run as daemon. In the case that it attempts to use an encrypted key, it is better suited to skipping the check and reporting failure than pausing to prompt for a passphrase. The patch adds a :interactive option to the Net::SSH.start options hash. The option defaults to true, which makes it backward compatible. If set to false, no "prompter" is provided and the library will never stop to prompt a user. Additionally, I made a modification which allows more fine grained failure handling in code calling Net::SSH.start. If :interactive is set to false and an encrypted key is available but without the corresponding passphrase, then Net::SSH::AuthenticationFailed is raised. If an incorrect passphrase is entered, OpenSSL::PKey::RSAError is raised, the same as before my patch. The patch includes updated manual sources, and unit tests for several aspects of the new behavior. I think you''ll find it to be a valuable addition to the Net:SSH library. If there is anything else I can be of assistance with, please let me know. Thanks, John R. Mishanski Jr. -------------- next part -------------- A non-text attachment was scrubbed... Name: net-ssh-interactive-option.patch Type: text/x-patch Size: 20416 bytes Desc: not available Url : http://rubyforge.org/pipermail/net-ssh-devel/attachments/20051225/d33b6de2/net-ssh-interactive-option-0001.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 256 bytes Desc: OpenPGP digital signature Url : http://rubyforge.org/pipermail/net-ssh-devel/attachments/20051225/d33b6de2/signature-0001.bin