diff cli-session.c @ 734:619b1ed837fd

Be a bit more careful about when we want to use CLI_AUTH_IMMEDIATE Only use it if we have pubkeys to try, or we have $DROPBEAR_PASSWORD set
author Matt Johnston <matt@ucc.asn.au>
date Tue, 02 Apr 2013 00:11:53 +0800
parents 70811267715c
children 077bbe1eb220
line wrap: on
line diff
--- a/cli-session.c	Mon Apr 01 22:26:55 2013 +0800
+++ b/cli-session.c	Tue Apr 02 00:11:53 2013 +0800
@@ -221,7 +221,9 @@
 			return;
 			
 		case USERAUTH_FAIL_RCVD:
-			cli_auth_try();
+			if (cli_auth_try() == DROPBEAR_FAILURE) {
+				dropbear_exit("No auth methods could be used.");
+			}
 			cli_ses.state = USERAUTH_REQ_SENT;
 			TRACE(("leave cli_sessionloop: cli_auth_try"))
 			return;