Attached is a patch to libssh2_userauth_password() to handle a failed login (i.e. bad username or password). When a failed login occurs, the server responds with SSH_MSG_USERAUTH_FAILURE which isn't handled in libssh2_userauth_password() and it ends up dropping out with -1, but the error code given is LIBSSH2_ERROR_EAGAIN, which isn't correct.

The patch adds a new error code, LIBSSH2_ERROR_LOGIN_FAILED which is returned in the case of SSH_MSG_USERAUTH_FAILURE (this is the same as the logic in libssh2_userauth_publickey_fromfile() that handles an unrecognized public key).

Thanks!

Attachment: 0001-Squashed-commit-of-the-following.patch
Description: Binary data




_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel

Reply via email to