summaryrefslogtreecommitdiff
path: root/cli-agentfwd.c
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
commit74881bf3c3feb6c521e5ff58fcd3a2645bf95fae (patch)
tree058f117f54a3f3b44fa895ec3de7c262d04b9d3a /cli-agentfwd.c
parent8e1b5a0999435f4a3538bfcf55c464e2153683e1 (diff)
downloaddropbear-74881bf3c3feb6c521e5ff58fcd3a2645bf95fae.tar.gz
- Handle failure to connect to forwarding socket
Diffstat (limited to 'cli-agentfwd.c')
-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);