# HG changeset patch # User Matt Johnston # Date 1364826384 -28800 # Node ID 2e5f2bc60e40bae9744787db497223c0c0428407 # Parent 9a54382715561c0e00270591c2800ed53ab5ea0c Try password before interactive - bit of a hack diff -r 9a5438271556 -r 2e5f2bc60e40 cli-auth.c --- a/cli-auth.c Mon Apr 01 00:07:26 2013 +0800 +++ b/cli-auth.c Mon Apr 01 22:26:24 2013 +0800 @@ -257,6 +257,16 @@ } #endif +#ifdef ENABLE_CLI_PASSWORD_AUTH + if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { + fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n"); + } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { + cli_auth_password(); + finished = 1; + cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; + } +#endif + #ifdef ENABLE_CLI_INTERACT_AUTH if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { fprintf(stderr, "Sorry, I won't let you use interactive auth unencrypted.\n"); @@ -271,16 +281,6 @@ } #endif -#ifdef ENABLE_CLI_PASSWORD_AUTH - if (ses.keys->trans.algo_crypt->cipherdesc == NULL) { - fprintf(stderr, "Sorry, I won't let you use password auth unencrypted.\n"); - } else if (!finished && ses.authstate.authtypes & AUTH_TYPE_PASSWORD) { - cli_auth_password(); - finished = 1; - cli_ses.lastauthtype = AUTH_TYPE_PASSWORD; - } -#endif - TRACE(("cli_auth_try lastauthtype %d", cli_ses.lastauthtype)) if (!finished) {