aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-04-24 23:01:18 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2010-04-24 23:01:18 +0200
commit97d2f755c415f1f0adbdcc7237ee9c3303e8e90b (patch)
treecc8c06dc4b52a0cdb0710194b9d1ca2ea4e6739e /libssh
parent83536ab7d1fc01c3bd1c8947261d484ffb0eec10 (diff)
downloadlibssh-97d2f755c415f1f0adbdcc7237ee9c3303e8e90b.tar.gz
libssh-97d2f755c415f1f0adbdcc7237ee9c3303e8e90b.tar.xz
libssh-97d2f755c415f1f0adbdcc7237ee9c3303e8e90b.zip
Do not send twice ssh_userauth_none requests
Thanks to Xi Wang for the bug report
Diffstat (limited to 'libssh')
-rw-r--r--libssh/auth.c7
1 files changed, 6 insertions, 1 deletions
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) {