FWD: enable forwarding to remote named sockets in ssh

Todd C. Miller Todd.Miller at courtesan.com
Tue Jun 2 08:43:15 AEST 2015


I'd prefer the following.

 - todd

Index: channels.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/channels.c,v
retrieving revision 1.343
diff -u -p -u -r1.343 channels.c
--- channels.c	8 May 2015 03:25:07 -0000	1.343
+++ channels.c	1 Jun 2015 22:12:31 -0000
@@ -2778,17 +2778,21 @@ channel_setup_fwd_listener_tcpip(int typ
 	char ntop[NI_MAXHOST], strport[NI_MAXSERV];
 	in_port_t *lport_p;
 
-	host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
-	    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 (is_client && fwd->connect_path != NULL) {
+		host = fwd->connect_path;
+	} else {
+		host = (type == SSH_CHANNEL_RPORT_LISTENER) ?
+		    fwd->listen_host : fwd->connect_host;
+		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 */


More information about the openssh-unix-dev mailing list