From ff85f3d366d4370653a2ed92b1711f602f8e1ab2 Mon Sep 17 00:00:00 2001 From: Salvador Fandino Date: Tue, 24 Feb 2015 11:37:05 +0100 Subject: [PATCH] ensure plink exits with a failure return code (1) when it is unable to reach the authentication successful state --- ssh.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssh.c b/ssh.c index c4c4fb9..1176a6f 100644 --- a/ssh.c +++ b/ssh.c @@ -4734,6 +4734,8 @@ static int do_ssh1_login(Ssh ssh, unsigned char *in, int inlen, sfree(s->publickey_comment); } + ssh->exitcode = -1; + logevent("Authentication successful"); crFinish(1); @@ -10633,7 +10635,7 @@ static const char *ssh_init(void *frontend_handle, void **backend_handle, ssh->kex_ctx = NULL; ssh->hostkey = NULL; ssh->hostkey_str = NULL; - ssh->exitcode = -1; + ssh->exitcode = 1; ssh->close_expected = FALSE; ssh->clean_exit = FALSE; ssh->state = SSH_STATE_PREPACKET; -- 2.1.4