mirror of
https://github.com/moparisthebest/curl
synced 2024-11-10 11:35:07 -05:00
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
This commit is contained in:
parent
5719e56168
commit
17de1cc382
@ -2587,11 +2587,10 @@ static CURLcode ssh_connect(struct connectdata *conn, bool *done)
|
|||||||
rc = libssh2_knownhost_readfile(ssh->kh,
|
rc = libssh2_knownhost_readfile(ssh->kh,
|
||||||
data->set.str[STRING_SSH_KNOWNHOSTS],
|
data->set.str[STRING_SSH_KNOWNHOSTS],
|
||||||
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
|
LIBSSH2_KNOWNHOST_FILE_OPENSSH);
|
||||||
if(rc) {
|
if(rc < 0)
|
||||||
infof(data, "Failed to read known hosts from %s\n",
|
infof(data, "Failed to read known hosts from %s\n",
|
||||||
data->set.str[STRING_SSH_KNOWNHOSTS]);
|
data->set.str[STRING_SSH_KNOWNHOSTS]);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif /* HAVE_LIBSSH2_KNOWNHOST_API */
|
#endif /* HAVE_LIBSSH2_KNOWNHOST_API */
|
||||||
|
|
||||||
#ifdef CURL_LIBSSH2_DEBUG
|
#ifdef CURL_LIBSSH2_DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user