changeset 565:1929bbe3fa84

merge of '0d7a9127af37d6e74efc5ec031a7001ce63d334d' and 'e35cd321b6d4fab6ad854827249f610da3bb6878'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 25 Aug 2009 11:11:35 +0000
parents 12fc5b342dc0 (diff) fad3eb63b907 (current diff)
children b321aeb57c64
files
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/cli-agentfwd.c	Tue Aug 25 05:24:18 2009 +0000
+++ b/cli-agentfwd.c	Tue Aug 25 11:11:35 2009 +0000
@@ -66,6 +66,10 @@
 
 	fd = connect_unix(agent_sock);
 
+	if (fd < 0) {
+		dropbear_log(LOG_INFO, "Failed to connect to agent");
+	}
+
 	return fd;
 }
 
@@ -79,6 +83,9 @@
 		return SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
 
 	fd = connect_agent();
+	if (cli_opts.agent_fd < 0) {
+		return SSH_OPEN_CONNECT_FAILED;
+	}
 
 	setnonblocking(fd);
 
@@ -243,7 +250,6 @@
 	/* agent_fd will be closed after successful auth */
 	cli_opts.agent_fd = connect_agent();
 	if (cli_opts.agent_fd < 0) {
-		dropbear_log(LOG_INFO, "Failed to connect to agent");
 		return;
 	}