Patch to allow local port forwarding from an existing connection

Markus Friedl markus at openbsd.org
Fri Sep 21 17:42:23 EST 2001


On Thu, Sep 20, 2001 at 11:43:59AM -0700, Brian Wellington wrote:
> On Thu, 20 Sep 2001, Markus Friedl wrote:
> 
> > On Wed, Sep 19, 2001 at 05:04:51PM -0700, Brian Wellington wrote:
> > > Hi.  Attached is a patch that introduces a new escape character (~c) that
> > > opens a command line.  From the command line, a command of the form:
> > >
> > > 	-L port:host:hostport
> > >
> > > can be entered, which will forward the local port, as if the same option
> > > has been provided on the command line.  I attempted to allow remote port
> > > forwards to be specified similarly, but the server disconnects with a
> > > protocol error (and the code is disabled now).
> > >
> > > This is a bit of a hack, but it works, and it's something that I've been
> > > hoping would be added to ssh for a few years now.
> > >
> > > The patch is against openssh-2.9p2.
> > >
> > > Comments?  Any chance this will get integrated?
> > > +	fprintf(stderr, "\r\n> ");
> > > +	s = fgets(string, sizeof string, stdin);
> >
> > i don't think reading from stdin is correct.
> > you need to read from the same FD as bin.
> 
> >From what I can tell, process_escapes is called from client_process_input,
> and stdin_buffer is passed in as 'bin'.  The fd is hardcoded as
> 'fileno(stdin)' in client_process_input.

no. this is only true for ssh1.



More information about the openssh-unix-dev mailing list