diff options
author | Daniel Stenberg <daniel@haxx.se> | 2011-02-26 10:59:03 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2011-02-26 11:00:44 +0100 |
commit | 17de1cc3827c7229db3263cc18fdd186bccd1e6e (patch) | |
tree | 6682c2afafabe74431a43ec32b139d2e15fbf01a | |
parent | 5719e5616805b246128f68bb282b941af949268e (diff) |
ssh_connect: treat libssh2 return code better
libssh2_knownhost_readfile() returns a negative value on error or
otherwise number of parsed known hosts - this was previously not
documented correctly in the libssh2 man page for the function.
Bug: http://curl.haxx.se/mail/lib-2011-02/0327.html
Reported by: murat
-rw-r--r-- | lib/ssh.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -2587,10 +2587,9 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done) rc = libssh2_knownhost_readfile(ssh->kh, data->set.str[STRING_SSH_KNOWNHOSTS], LIBSSH2_KNOWNHOST_FILE_OPENSSH); - if(rc) { + if(rc < 0) infof(data, "Failed to read known hosts from %s\n", data->set.str[STRING_SSH_KNOWNHOSTS]); - } } #endif /* HAVE_LIBSSH2_KNOWNHOST_API */ |