From 1044621582968fd2dbf5d797b79524f22cfa747f Mon Sep 17 00:00:00 2001 From: simon Date: Mon, 19 Mar 2001 10:27:59 +0000 Subject: [PATCH] Plink in noninteractive-script mode should not show the `Authenticated with public key' message in SSH2 (it already doesn't in SSH1). It shouldn't show the login banner either, since its output is probably redirected to something which will choke on it. git-svn-id: svn://svn.tartarus.org/sgt/putty@1011 cda61777-01e9-0310-a592-d414129be87e --- ssh.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/ssh.c b/ssh.c index fe5b05ef..627a16f1 100644 --- a/ssh.c +++ b/ssh.c @@ -2979,9 +2979,19 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt) while (pktin.type == SSH2_MSG_USERAUTH_BANNER) { char *banner; int size; - ssh2_pkt_getstring(&banner, &size); - if (banner) - c_write_untrusted(banner, size); + /* + * Don't show the banner if we're operating in + * non-verbose non-interactive mode. (It's probably + * a script, which means nobody will read the + * banner _anyway_, and moreover the printing of + * the banner will screw up processing on the + * output of (say) plink.) + */ + if (flags & (FLAG_VERBOSE | FLAG_INTERACTIVE)) { + ssh2_pkt_getstring(&banner, &size); + if (banner) + c_write_untrusted(banner, size); + } crWaitUntilV(ispkt); } if (pktin.type == SSH2_MSG_USERAUTH_SUCCESS) { @@ -3110,9 +3120,11 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt) continue; } - c_write_str("Authenticating with public key \""); - c_write(commentp, commentlen); - c_write_str("\" from agent\r\n"); + if (flags & FLAG_VERBOSE) { + c_write_str("Authenticating with public key \""); + c_write(commentp, commentlen); + c_write_str("\" from agent\r\n"); + } /* * Server is willing to accept the key. -- 2.11.0