From 97d2f755c415f1f0adbdcc7237ee9c3303e8e90b Mon Sep 17 00:00:00 2001 From: Aris Adamantiadis Date: Sat, 24 Apr 2010 23:01:18 +0200 Subject: Do not send twice ssh_userauth_none requests Thanks to Xi Wang for the bug report --- libssh/auth.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libssh/auth.c b/libssh/auth.c index 3961f788..2e801947 100644 --- a/libssh/auth.c +++ b/libssh/auth.c @@ -301,7 +301,12 @@ int ssh_userauth_none(ssh_session session, const char *username) { return rc; } #endif - + if(session->auth_methods != 0){ + /* userauth_none or other method was already tried before */ + ssh_set_error(session,SSH_REQUEST_DENIED,"None method rejected by server"); + leave_function(); + return SSH_AUTH_DENIED; + } if (username == NULL) { if (session->username == NULL) { if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) { -- cgit