diff options
author | Damien Miller <djm@mindrot.org> | 2005-06-17 12:55:03 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2005-06-17 12:55:03 +1000 |
commit | 677257fe07dd2b9a58817e1d42fc2c25bb618a4d (patch) | |
tree | 087406abe9a0f12491122452ecad2b44a04d7908 | |
parent | 17e7ed0e754577ae61cdd5e3f03b33fba2a09337 (diff) |
- markus@cvs.openbsd.org 2005/06/16 08:00:00
[canohost.c channels.c sshd.c]
don't exit if getpeername fails for forwarded ports; bugzilla #1054;
ok djm
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | canohost.c | 4 | ||||
-rw-r--r-- | channels.c | 6 | ||||
-rw-r--r-- | sshd.c | 7 |
4 files changed, 15 insertions, 9 deletions
@@ -4,7 +4,10 @@ | |||
4 | [channels.c channels.h clientloop.c clientloop.h ssh.c] | 4 | [channels.c channels.h clientloop.c clientloop.h ssh.c] |
5 | move x11_get_proto from ssh.c to clientloop.c, to make muliplexed xfwd | 5 | move x11_get_proto from ssh.c to clientloop.c, to make muliplexed xfwd |
6 | easier later; ok deraadt@ | 6 | easier later; ok deraadt@ |
7 | 7 | - markus@cvs.openbsd.org 2005/06/16 08:00:00 | |
8 | [canohost.c channels.c sshd.c] | ||
9 | don't exit if getpeername fails for forwarded ports; bugzilla #1054; | ||
10 | ok djm | ||
8 | 11 | ||
9 | 20050616 | 12 | 20050616 |
10 | - (djm) OpenBSD CVS Sync | 13 | - (djm) OpenBSD CVS Sync |
@@ -2722,4 +2725,4 @@ | |||
2722 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 2725 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
2723 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 2726 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
2724 | 2727 | ||
2725 | $Id: ChangeLog,v 1.3821 2005/06/17 02:54:33 djm Exp $ | 2728 | $Id: ChangeLog,v 1.3822 2005/06/17 02:55:03 djm Exp $ |
diff --git a/canohost.c b/canohost.c index 94d666432..c3ab45556 100644 --- a/canohost.c +++ b/canohost.c | |||
@@ -12,7 +12,7 @@ | |||
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "includes.h" | 14 | #include "includes.h" |
15 | RCSID("$OpenBSD: canohost.c,v 1.42 2005/02/18 03:05:53 djm Exp $"); | 15 | RCSID("$OpenBSD: canohost.c,v 1.43 2005/06/16 08:00:00 markus Exp $"); |
16 | 16 | ||
17 | #include "packet.h" | 17 | #include "packet.h" |
18 | #include "xmalloc.h" | 18 | #include "xmalloc.h" |
@@ -346,7 +346,7 @@ get_sock_port(int sock, int local) | |||
346 | } else { | 346 | } else { |
347 | if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) { | 347 | if (getpeername(sock, (struct sockaddr *)&from, &fromlen) < 0) { |
348 | debug("getpeername failed: %.100s", strerror(errno)); | 348 | debug("getpeername failed: %.100s", strerror(errno)); |
349 | cleanup_exit(255); | 349 | return -1; |
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
diff --git a/channels.c b/channels.c index 440043b9c..66b15f5b5 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.215 2005/06/16 03:38:36 djm Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.216 2005/06/16 08:00:00 markus Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -1178,7 +1178,7 @@ port_open_helper(Channel *c, char *rtype) | |||
1178 | int direct; | 1178 | int direct; |
1179 | char buf[1024]; | 1179 | char buf[1024]; |
1180 | char *remote_ipaddr = get_peer_ipaddr(c->sock); | 1180 | char *remote_ipaddr = get_peer_ipaddr(c->sock); |
1181 | u_short remote_port = get_peer_port(c->sock); | 1181 | int remote_port = get_peer_port(c->sock); |
1182 | 1182 | ||
1183 | direct = (strcmp(rtype, "direct-tcpip") == 0); | 1183 | direct = (strcmp(rtype, "direct-tcpip") == 0); |
1184 | 1184 | ||
@@ -1208,7 +1208,7 @@ port_open_helper(Channel *c, char *rtype) | |||
1208 | } | 1208 | } |
1209 | /* originator host and port */ | 1209 | /* originator host and port */ |
1210 | packet_put_cstring(remote_ipaddr); | 1210 | packet_put_cstring(remote_ipaddr); |
1211 | packet_put_int(remote_port); | 1211 | packet_put_int((u_int)remote_port); |
1212 | packet_send(); | 1212 | packet_send(); |
1213 | } else { | 1213 | } else { |
1214 | packet_start(SSH_MSG_PORT_OPEN); | 1214 | packet_start(SSH_MSG_PORT_OPEN); |
@@ -42,7 +42,7 @@ | |||
42 | */ | 42 | */ |
43 | 43 | ||
44 | #include "includes.h" | 44 | #include "includes.h" |
45 | RCSID("$OpenBSD: sshd.c,v 1.309 2005/04/06 09:43:59 djm Exp $"); | 45 | RCSID("$OpenBSD: sshd.c,v 1.310 2005/06/16 08:00:00 markus Exp $"); |
46 | 46 | ||
47 | #include <openssl/dh.h> | 47 | #include <openssl/dh.h> |
48 | #include <openssl/bn.h> | 48 | #include <openssl/bn.h> |
@@ -1626,7 +1626,10 @@ main(int ac, char **av) | |||
1626 | setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0) | 1626 | setsockopt(sock_in, SOL_SOCKET, SO_KEEPALIVE, &on, sizeof(on)) < 0) |
1627 | error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno)); | 1627 | error("setsockopt SO_KEEPALIVE: %.100s", strerror(errno)); |
1628 | 1628 | ||
1629 | remote_port = get_remote_port(); | 1629 | if ((remote_port = get_remote_port()) < 0) { |
1630 | debug("get_remote_port failed"); | ||
1631 | cleanup_exit(255); | ||
1632 | } | ||
1630 | remote_ip = get_remote_ipaddr(); | 1633 | remote_ip = get_remote_ipaddr(); |
1631 | 1634 | ||
1632 | #ifdef SSH_AUDIT_EVENTS | 1635 | #ifdef SSH_AUDIT_EVENTS |