From: simon Date: Mon, 19 Mar 2001 10:27:59 +0000 (+0000) Subject: Plink in noninteractive-script mode should not show the `Authenticated X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/1044621582968fd2dbf5d797b79524f22cfa747f?ds=inline 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 --- 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.