From: jacob Date: Fri, 19 Nov 2004 20:57:32 +0000 (+0000) Subject: Remove FLAG_INTERACTIVE test from "login as:" prompt. Kelly John Carney X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/aa09f7d03c79870c460fa57602673d48e3d6aa1f Remove FLAG_INTERACTIVE test from "login as:" prompt. Kelly John Carney pointed out that Plink would attempt to use a zero-length username iff a remote command was specified (because the FLAG_INTERACTIVE test was erroneously combined with the no-username test). I don't think this will break non-interactive use; in the cases which behave differently, Plink would be attempting to use the empty username, which was almost certainly wrong, whereas now it will give a prompt (which can be avoided with -batch as usual). (Although perhaps we should attempt to use a local username as a guess for the remote username, as PSCP does? I've not done this.) git-svn-id: svn://svn.tartarus.org/sgt/putty@4831 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/ssh.c b/ssh.c index 42e20775..ee5a0894 100644 --- a/ssh.c +++ b/ssh.c @@ -2757,7 +2757,7 @@ static int do_ssh1_login(Ssh ssh, unsigned char *in, int inlen, int ispkt) fflush(stdout); { - if ((flags & FLAG_INTERACTIVE) && !*ssh->cfg.username) { + if (!*ssh->cfg.username) { if (ssh_get_line && !ssh_getline_pw_only) { if (!ssh_get_line("login as: ", s->username, sizeof(s->username), FALSE)) { @@ -4841,7 +4841,7 @@ static void do_ssh2_authconn(Ssh ssh, unsigned char *in, int inlen, int ispkt) * with change_username turned off we don't try to get * it again. */ - } else if ((flags & FLAG_INTERACTIVE) && !*ssh->cfg.username) { + } else if (!*ssh->cfg.username) { if (ssh_get_line && !ssh_getline_pw_only) { if (!ssh_get_line("login as: ", s->username, sizeof(s->username), FALSE)) {