net-ssh is too brittle
Reported by RichMorin | May 31st, 2008 @ 07:26 PM
If ~/.ssh/known_hosts contains a blank line, net-ssh will crash
(trying to split Nil) at:
.../gems/net-ssh-2.0.1/lib/net/ssh/
known_hosts.rb:101:in `keys_for'
The man page for ssh_config(5) on Mac OS X 10.4 says:
...
The configuration file has the following format:
Empty lines and lines starting with `#' are comments.
...
P.S. Sorry if this is the wrong bug tracker to use; I couldn't find one for the net-ssh gem, per se.
Comments and changes to this ticket
-
Jamis Buck June 2nd, 2008 @ 09:04 PM
- → State changed from new to open
Actually, the known_hosts implementation in Net::SSH works fine with blank lines, at least as far as I can duplicate. I've added blanks in my own file and it doesn't cause any problems at all, the code does actually check for (and ignore) blank lines and comments. Can you still duplicate this?
-

RichMorin June 2nd, 2008 @ 11:53 PM
I can duplicate the problem quite easily, in either of two ways:
- Begin the file with a blank line.
- Begin the file with a comment line, followed by a blank line.
I have enclosed a tarfile with examples of each.
-
Jamis Buck June 27th, 2008 @ 10:32 AM
- → Tag changed from to ssh
I'm really not sure what's going on. I can't duplicate this at all, even using the known_host samples you uploaded. I'm afraid you're going to need to dig in and see what's going on. I suspect there's something funky with your environment--what OS are you using? And what Net::SSH version?
-
Jamis Buck August 17th, 2008 @ 07:17 PM
- → State changed from open to invalid
- → Tag changed from ssh to ssh worksforme
In the absence of further info, and remaining unable to duplicate the issue, I'm going to close this. If it is still an issue, and if more information is available, please feel free to reopen this ticket.
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
