1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-21 14:00:51 +03:00

userauth_password: pass on the underlying error code

_libssh2_packet_requirev() may return different errors and we pass that
to the parent instead of rewriting it.

Bug: http://libssh2.org/mail/libssh2-devel-archive-2013-04/0029.shtml
Reported by: Cosmin
This commit is contained in:
Daniel Stenberg
2013-04-17 15:31:12 +02:00
parent 16ef83dd81
commit d7f9cd57c5

View File

@@ -276,13 +276,13 @@ userauth_password(LIBSSH2_SESSION *session,
0, NULL, 0,
&session->
userauth_pswd_packet_requirev_state);
if (rc == LIBSSH2_ERROR_EAGAIN) {
return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN,
"Would block waiting");
} else if (rc) {
if (rc) {
if (rc != LIBSSH2_ERROR_EAGAIN)
session->userauth_pswd_state = libssh2_NB_state_idle;
return _libssh2_error(session, LIBSSH2_ERROR_TIMEOUT,
"Would block waiting");
return _libssh2_error(session, rc,
"Waiting for password response");
}
if (session->userauth_pswd_data[0] == SSH_MSG_USERAUTH_SUCCESS) {