summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2009-07-31 15:51:33 +0000
committerMatt Johnston <matt@ucc.asn.au>2009-07-31 15:51:33 +0000
commitf15feb2ac6123eebe27b859efd83f7df94dc8146 (patch)
tree058f117f54a3f3b44fa895ec3de7c262d04b9d3a
parent2f1ed9a34b6b5ba611d033966ca7b067ee06c574 (diff)
- Handle failure to connect to forwarding socket
--HG-- extra : convert_revision : 0cc1ae25ba35931d6ddd9e989e875ef975616be6
-rw-r--r--cli-agentfwd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cli-agentfwd.c b/cli-agentfwd.c
index c7df788..eed4a6a 100644
--- a/cli-agentfwd.c
+++ b/cli-agentfwd.c
@@ -79,6 +79,10 @@ static int new_agent_chan(struct Channel * channel) {
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);