Dear openssh developers,
has the problem related to remote unix socket forwarding to a local port
ever been fixed? (see message below: ssh -L 12345:/tmp/sock)
I could not find any code containing the patch (maybe i am looking in
the wrong places)
I actually had the same problem and the feature is really handy if you
are working on a windows machine.
Help is apreciated. Thanks!
Best regards,
Till Riedel
-------- Forwarded Message --------
List: openbsd-tech
Subject: enable forwarding to remote named sockets in ssh
From: Jared Yanovich <slovichon () gmail ! com>
Date: 2014-08-08 20:38:11
Message-ID: 20140808203811.GK16425 () nightderanger ! psc ! edu
[Download message RAW]
I cannot forward to a socket on the remote host ("No forward host
name.").
Example:
ssh -L 12345:/tmp/sock
Index: channels.c
==================================================================RCS file:
/cvs/src/usr.bin/ssh/channels.c,v
retrieving revision 1.336
diff -u -p -r1.336 channels.c
--- channels.c 15 Jul 2014 15:54:14 -0000 1.336
+++ channels.c 8 Aug 2014 20:31:29 -0000
@@ -2771,13 +2770,18 @@ channel_setup_fwd_listener_tcpip(int typ
fwd->listen_host : fwd->connect_host;
is_client = (type == SSH_CHANNEL_PORT_LISTENER);
- if (host == NULL) {
- error("No forward host name.");
- return 0;
- }
- if (strlen(host) >= NI_MAXHOST) {
- error("Forward host name too long.");
- return 0;
+ if (type == SSH_CHANNEL_PORT_LISTENER &&
+ fwd->connect_path)
+ host = fwd->connect_path;
+ else {
+ if (host == NULL) {
+ error("No forward host name.");
+ return 0;
+ }
+ if (strlen(host) >= NI_MAXHOST) {
+ error("Forward host name too long.");
+ return 0;
+ }
}
/* Determine the bind address, cf. channel_fwd_bind_addr() comment */
--
Karlsruhe Institute of Technology (KIT)
TECO - Technology for Pervasive Computing
Dr.-Ing. Dipl.-Inform. Till Riedel
Research Director TECO
post: KIT, TecO, Vincenz-Priessnitz-Str. 1, 76131 Karlsruhe, Germany
fon: +49 721 608-41706 , fax: +49 721 608-41702
email: riedel at teco.edu , web: www.teco.edu/people/riedel
KIT ? University of the State of Baden-Wuerttemberg
and National Large-scale Research Center of the Helmholtz Association
Hi, Did you file a bug at https://bugzilla.mindrot.org/ ? That's the best way to ensure fixes don't get lost. -d On Sun, 31 May 2015, Till Riedel wrote:> Dear openssh developers, > > has the problem related to remote unix socket forwarding to a local port > ever been fixed? (see message below: ssh -L 12345:/tmp/sock) > > I could not find any code containing the patch (maybe i am looking in > the wrong places) > > I actually had the same problem and the feature is really handy if you > are working on a windows machine. > > Help is apreciated. Thanks! > > Best regards, > > Till Riedel > > -------- Forwarded Message -------- > List: openbsd-tech > Subject: enable forwarding to remote named sockets in ssh > From: Jared Yanovich <slovichon () gmail ! com> > Date: 2014-08-08 20:38:11 > Message-ID: 20140808203811.GK16425 () nightderanger ! psc ! edu > [Download message RAW] > > I cannot forward to a socket on the remote host ("No forward host name."). > > Example: > > ssh -L 12345:/tmp/sock > > Index: channels.c > ==================================================================> RCS file: /cvs/src/usr.bin/ssh/channels.c,v > retrieving revision 1.336 > diff -u -p -r1.336 channels.c > --- channels.c 15 Jul 2014 15:54:14 -0000 1.336 > +++ channels.c 8 Aug 2014 20:31:29 -0000 > @@ -2771,13 +2770,18 @@ channel_setup_fwd_listener_tcpip(int typ > fwd->listen_host : fwd->connect_host; > is_client = (type == SSH_CHANNEL_PORT_LISTENER); > > - if (host == NULL) { > - error("No forward host name."); > - return 0; > - } > - if (strlen(host) >= NI_MAXHOST) { > - error("Forward host name too long."); > - return 0; > + if (type == SSH_CHANNEL_PORT_LISTENER && > + fwd->connect_path) > + host = fwd->connect_path; > + else { > + if (host == NULL) { > + error("No forward host name."); > + return 0; > + } > + if (strlen(host) >= NI_MAXHOST) { > + error("Forward host name too long."); > + return 0; > + } > } > > /* Determine the bind address, cf. channel_fwd_bind_addr() comment */ > -- > Karlsruhe Institute of Technology (KIT) > TECO - Technology for Pervasive Computing > > Dr.-Ing. Dipl.-Inform. Till Riedel > Research Director TECO > > post: KIT, TecO, Vincenz-Priessnitz-Str. 1, 76131 Karlsruhe, Germany > fon: +49 721 608-41706 , fax: +49 721 608-41702 > email: riedel at teco.edu , web: www.teco.edu/people/riedel > > KIT ? University of the State of Baden-Wuerttemberg > and National Large-scale Research Center of the Helmholtz Association > _______________________________________________ > openssh-unix-dev mailing list > openssh-unix-dev at mindrot.org > https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >
Thx, I filed it as #2406. Patch still seems to work against current snapshot. I didn't post it originally because it already was reported once and I couldn't figure out why it wasn't followed up on. BR Till PS: the patch would make quite a difference for docker for windows users as it enables one to forward the client to a remote machine without changing the host config. Am 01.06.2015 um 03:33 schrieb Damien Miller:> Hi, > > Did you file a bug at https://bugzilla.mindrot.org/ ? That's the best > way to ensure fixes don't get lost. > > -d > > On Sun, 31 May 2015, Till Riedel wrote: > >> Dear openssh developers, >> >> has the problem related to remote unix socket forwarding to a local port >> ever been fixed? (see message below: ssh -L 12345:/tmp/sock) >> >> I could not find any code containing the patch (maybe i am looking in >> the wrong places) >> >> I actually had the same problem and the feature is really handy if you >> are working on a windows machine. >> >> Help is apreciated. Thanks! >> >> Best regards, >> >> Till Riedel >> >> -------- Forwarded Message -------- >> List: openbsd-tech >> Subject: enable forwarding to remote named sockets in ssh >> From: Jared Yanovich <slovichon () gmail ! com> >> Date: 2014-08-08 20:38:11 >> Message-ID: 20140808203811.GK16425 () nightderanger ! psc ! edu >> [Download message RAW] >> >> I cannot forward to a socket on the remote host ("No forward host name."). >> >> Example: >> >> ssh -L 12345:/tmp/sock >> >> Index: channels.c >> ==================================================================>> RCS file: /cvs/src/usr.bin/ssh/channels.c,v >> retrieving revision 1.336 >> diff -u -p -r1.336 channels.c >> --- channels.c 15 Jul 2014 15:54:14 -0000 1.336 >> +++ channels.c 8 Aug 2014 20:31:29 -0000 >> @@ -2771,13 +2770,18 @@ channel_setup_fwd_listener_tcpip(int typ >> fwd->listen_host : fwd->connect_host; >> is_client = (type == SSH_CHANNEL_PORT_LISTENER); >> >> - if (host == NULL) { >> - error("No forward host name."); >> - return 0; >> - } >> - if (strlen(host) >= NI_MAXHOST) { >> - error("Forward host name too long."); >> - return 0; >> + if (type == SSH_CHANNEL_PORT_LISTENER && >> + fwd->connect_path) >> + host = fwd->connect_path; >> + else { >> + if (host == NULL) { >> + error("No forward host name."); >> + return 0; >> + } >> + if (strlen(host) >= NI_MAXHOST) { >> + error("Forward host name too long."); >> + return 0; >> + } >> } >> >> /* Determine the bind address, cf. channel_fwd_bind_addr() comment */ >> -- >> Karlsruhe Institute of Technology (KIT) >> TECO - Technology for Pervasive Computing >> >> Dr.-Ing. Dipl.-Inform. Till Riedel >> Research Director TECO >> >> post: KIT, TecO, Vincenz-Priessnitz-Str. 1, 76131 Karlsruhe, Germany >> fon: +49 721 608-41706 , fax: +49 721 608-41702 >> email: riedel at teco.edu , web: www.teco.edu/people/riedel >> >> KIT ? University of the State of Baden-Wuerttemberg >> and National Large-scale Research Center of the Helmholtz Association >> _______________________________________________ >> openssh-unix-dev mailing list >> openssh-unix-dev at mindrot.org >> https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev >>-- Karlsruhe Institute of Technology (KIT) TECO - Technology for Pervasive Computing Dr.-Ing. Dipl.-Inform. Till Riedel Research Director TECO post: KIT, TecO, Vincenz-Priessnitz-Str. 1, 76131 Karlsruhe, Germany fon: +49 721 608-41706 , fax: +49 721 608-41702 email: riedel at teco.edu , web: www.teco.edu/people/riedel KIT ? University of the State of Baden-Wuerttemberg and National Large-scale Research Center of the Helmholtz Association