Bug 2255

Summary: tunneling with -W does not report non 0 exit codes on failure even with ExitOnForwardFailure=yes
Product: Portable OpenSSH Reporter: Brendan Germain <bcg62>
Component: sshAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: normal CC: bcg62, djm, dtucker, mr.danielaquino
Priority: P5    
Version: 6.6p1   
Hardware: amd64   
OS: Linux   
Bug Depends on:    
Bug Blocks: 2226    
Attachments:
Description Flags
delay reply to multiplexied stdio forwards until confirmation has been received dtucker: ok+

Description Brendan Germain 2014-07-16 04:30:15 AEST
Currently it looks like there is no way to trap unsuccessful port forwards using ssh -W

Example:

$ ssh -o ExitOnForwardFailure=yes -W localhost:1590 remotehost
$ echo $?
0

1590 is not listening on remotehost and debug output shows:

channel 0: open failed: connect failed: Connection refused 

But ssh exits with 0.

Changing ExitOnForwardFailure has no effect. 

It should exit(1) like nc does
Comment 1 Damien Miller 2014-07-16 15:18:50 AEST
Created attachment 2455 [details]
delay reply to multiplexied stdio forwards until confirmation has been received

I think this fixes it.
Comment 2 Darren Tucker 2014-07-17 12:20:26 AEST
Comment on attachment 2455 [details]
delay reply to multiplexied stdio forwards until confirmation has been received

looks like this only affects the mux case.
Comment 3 Damien Miller 2014-07-17 17:22:35 AEST
patch committed - this will be in openssh-6.7. Thanks!
Comment 4 Damien Miller 2014-07-28 09:44:14 AEST
This has been applied and will be in openssh-6.7. Thanks!
Comment 5 Damien Miller 2014-10-08 08:01:00 AEDT
Close all bugs left open from 6.6 and 6.7 releases.