Bug 2255 - tunneling with -W does not report non 0 exit codes on failure even with ExitOnForwardFailure=yes
Summary: tunneling with -W does not report non 0 exit codes on failure even with ExitO...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.6p1
Hardware: amd64 Linux
: P5 normal
Assignee: Damien Miller
URL:
Keywords:
Depends on:
Blocks: V_6_7
  Show dependency treegraph
 
Reported: 2014-07-16 04:30 AEST by Brendan Germain
Modified: 2014-10-08 08:01 AEDT (History)
4 users (show)

See Also:


Attachments
delay reply to multiplexied stdio forwards until confirmation has been received (3.87 KB, patch)
2014-07-16 15:18 AEST, Damien Miller
dtucker: ok+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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.