From 08c0648542c379047cf09b0eee2f33d4d17cf40f Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Tue, 11 Jul 2006 18:50:49 +0000 Subject: add ExitOnForwardFailure: terminate the connection if ssh(1) cannot set up all requested dynamic, local, and remote port forwardings. ok djm, dtucker, stevesk, jmc --- usr.bin/ssh/clientloop.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'usr.bin/ssh/clientloop.c') diff --git a/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index 98377bc7e67..a431b3d4e07 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: clientloop.c,v 1.166 2006/07/08 21:47:12 stevesk Exp $ */ +/* $OpenBSD: clientloop.c,v 1.167 2006/07/11 18:50:47 markus Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -992,9 +992,12 @@ process_cmdline(void) goto out; } } else { - channel_request_remote_forwarding(fwd.listen_host, + if (channel_request_remote_forwarding(fwd.listen_host, fwd.listen_port, fwd.connect_host, - fwd.connect_port); + fwd.connect_port) < 0) { + logit("Port forwarding failed."); + goto out; + } } logit("Forwarding port."); -- cgit v1.2.3