changeset 562:a900cb1c53fa

- Handle failure to connect to forwarding socket
author Matt Johnston <matt@ucc.asn.au>
date Fri, 31 Jul 2009 15:51:33 +0000
parents 541ebf5bf0f6
children 12fc5b342dc0
files cli-agentfwd.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/cli-agentfwd.c	Thu Jul 30 15:15:12 2009 +0000
+++ b/cli-agentfwd.c	Fri Jul 31 15:51:33 2009 +0000
@@ -79,6 +79,10 @@
 		return SSH_OPEN_ADMINISTRATIVELY_PROHIBITED;
 
 	fd = connect_agent();
+	if (cli_opts.agent_fd < 0) {
+		dropbear_log(LOG_INFO, "Failed to connect to agent");
+		return SSH_OPEN_CONNECT_FAILED;
+	}
 
 	setnonblocking(fd);