Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Apr 2002 03:28:32 -0700 (PDT)
From:      Petr Rehor <petr.rehor@i.cz>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/37245: OpenSSH -R port forwarding works with ssh v1 but not with ssh v2
Message-ID:  <200204191028.g3JASW685838@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         37245
>Category:       bin
>Synopsis:       OpenSSH -R port forwarding works with ssh v1 but not with ssh v2
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 19 03:30:02 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Petr Rehor
>Release:        FreeBSD 4.5-RELEASE-p2 i386
>Organization:
ICZ Czech Republic
>Environment:
FreeBSD noc.decros.cz 4.5-RELEASE-p2 FreeBSD 4.5-RELEASE-p2 #0: Fri Mar  8 22:22:02 CET 2002     reho@noc.decros.cz:/usr/obj/usr/src/sys/NOC  i386

>Description:
OpenSSH 2.9 -R port forwarding works with ssh v1 but not with ssh v2. -L port forwarding works for both protocols. It's fixes in OpenSSH

See:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=75341+0+archive/2002/freebsd-security/20020113.freebsd-security
http://www.freebsd.org/cgi/getmsg.cgi?fetch=81207+83038+/usr/local/www/db/text/2002/freebsd-security/20020113.freebsd-security

Patch available from:
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/channels.c.diff?r1=1.109.2.1&r2=1.109.2.2
>How-To-Repeat:
ssh -2 -R PORT:localhost:PORT remote

>Fix:
===================================================================
RCS file: /usr/OpenBSD/cvs/src/usr.bin/ssh/channels.c,v
retrieving revision 1.109.2.1
retrieving revision 1.109.2.2
diff -u -r1.109.2.1 -r1.109.2.2
--- src/usr.bin/ssh/channels.c	2001/06/12 22:31:48	1.109.2.1
+++ src/usr.bin/ssh/channels.c	2001/06/21 23:45:23	1.109.2.2
@@ -40,7 +40,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: channels.c,v 1.109.2.1 2001/06/12 22:31:48 jason Exp $");
+RCSID("$OpenBSD: channels.c,v 1.109.2.2 2001/06/21 23:45:23 jason Exp $");
 
 #include <openssl/rsa.h>
 #include <openssl/dsa.h>
@@ -773,8 +773,9 @@
 
 		rtype = (c->type == SSH_CHANNEL_RPORT_LISTENER) ?
 		    "forwarded-tcpip" : "direct-tcpip";
-		nextstate = (c->host_port == 0) ? SSH_CHANNEL_DYNAMIC :
-		    SSH_CHANNEL_OPENING;
+		nextstate = (c->host_port == 0 &&
+		    c->type != SSH_CHANNEL_RPORT_LISTENER) ?
+		    SSH_CHANNEL_DYNAMIC : SSH_CHANNEL_OPENING;
 
 		addrlen = sizeof(addr);
 		newsock = accept(c->sock, &addr, &addrlen);

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200204191028.g3JASW685838>