diff options
author | Damien Miller <djm@mindrot.org> | 2014-07-18 15:04:10 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2014-07-18 15:04:10 +1000 |
commit | 357610d15946381ae90c271837dcdd0cdce7145f (patch) | |
tree | e94ba70af3b190aa205f06b8eedf4b910c5dc2e2 /ssh.c | |
parent | dad9a4a0b7c2b5d78605f8df28718f116524134e (diff) |
- djm@cvs.openbsd.org 2014/07/17 07:22:19
[mux.c ssh.c]
reflect stdio-forward ("ssh -W host:port ...") failures in exit status.
previously we were always returning 0. bz#2255 reported by Brendan
Germain; ok dtucker
Diffstat (limited to 'ssh.c')
-rw-r--r-- | ssh.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh.c,v 1.406 2014/07/15 15:54:14 millert Exp $ */ | 1 | /* $OpenBSD: ssh.c,v 1.407 2014/07/17 07:22:19 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -1360,6 +1360,13 @@ client_cleanup_stdio_fwd(int id, void *arg) | |||
1360 | } | 1360 | } |
1361 | 1361 | ||
1362 | static void | 1362 | static void |
1363 | ssh_stdio_confirm(int id, int success, void *arg) | ||
1364 | { | ||
1365 | if (!success) | ||
1366 | fatal("stdio forwarding failed"); | ||
1367 | } | ||
1368 | |||
1369 | static void | ||
1363 | ssh_init_stdio_forwarding(void) | 1370 | ssh_init_stdio_forwarding(void) |
1364 | { | 1371 | { |
1365 | Channel *c; | 1372 | Channel *c; |
@@ -1379,6 +1386,7 @@ ssh_init_stdio_forwarding(void) | |||
1379 | stdio_forward_port, in, out)) == NULL) | 1386 | stdio_forward_port, in, out)) == NULL) |
1380 | fatal("%s: channel_connect_stdio_fwd failed", __func__); | 1387 | fatal("%s: channel_connect_stdio_fwd failed", __func__); |
1381 | channel_register_cleanup(c->self, client_cleanup_stdio_fwd, 0); | 1388 | channel_register_cleanup(c->self, client_cleanup_stdio_fwd, 0); |
1389 | channel_register_open_confirm(c->self, ssh_stdio_confirm, NULL); | ||
1382 | } | 1390 | } |
1383 | 1391 | ||
1384 | static void | 1392 | static void |