X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/aa09f7d03c79870c460fa57602673d48e3d6aa1f..45f23490ce0e9e7cb80b46de1be7b0faa25e2366:/ssh.c diff --git a/ssh.c b/ssh.c index ee5a0894..8c71e6df 100644 --- a/ssh.c +++ b/ssh.c @@ -5003,7 +5003,8 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) * Additionally, if we'd just tried password * authentication, we should break out of this * whole loop so as to go back to the username - * prompt. + * prompt (iff we're configured to allow + * username change attempts). */ if (s->type == AUTH_TYPE_NONE) { /* do nothing */ @@ -5017,7 +5018,10 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) } else { c_write_str(ssh, "Access denied\r\n"); logevent("Access denied"); - if (s->type == AUTH_TYPE_PASSWORD) { + if (s->type == AUTH_TYPE_PASSWORD && + ssh->cfg.change_username) { + /* XXX perhaps we should allow + * keyboard-interactive to do this too? */ s->we_are_in = FALSE; break; }