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:
@@ -276,13 +276,13 @@ userauth_password(LIBSSH2_SESSION *session,
|
|||||||
0, NULL, 0,
|
0, NULL, 0,
|
||||||
&session->
|
&session->
|
||||||
userauth_pswd_packet_requirev_state);
|
userauth_pswd_packet_requirev_state);
|
||||||
if (rc == LIBSSH2_ERROR_EAGAIN) {
|
|
||||||
return _libssh2_error(session, LIBSSH2_ERROR_EAGAIN,
|
if (rc) {
|
||||||
"Would block waiting");
|
if (rc != LIBSSH2_ERROR_EAGAIN)
|
||||||
} else if (rc) {
|
session->userauth_pswd_state = libssh2_NB_state_idle;
|
||||||
session->userauth_pswd_state = libssh2_NB_state_idle;
|
|
||||||
return _libssh2_error(session, LIBSSH2_ERROR_TIMEOUT,
|
return _libssh2_error(session, rc,
|
||||||
"Would block waiting");
|
"Waiting for password response");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (session->userauth_pswd_data[0] == SSH_MSG_USERAUTH_SUCCESS) {
|
if (session->userauth_pswd_data[0] == SSH_MSG_USERAUTH_SUCCESS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user