version 1.420, 2022/09/19 08:49:50 |
version 1.421, 2022/11/18 19:47:40 |
|
|
channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) |
channel_request_remote_forwarding(struct ssh *ssh, struct Forward *fwd) |
{ |
{ |
int r, success = 0, idx = -1; |
int r, success = 0, idx = -1; |
char *host_to_connect, *listen_host, *listen_path; |
const char *host_to_connect, *listen_host, *listen_path; |
int port_to_connect, listen_port; |
int port_to_connect, listen_port; |
|
|
/* Send the forward request to the remote side. */ |
/* Send the forward request to the remote side. */ |
|
|
host_to_connect = listen_host = listen_path = NULL; |
host_to_connect = listen_host = listen_path = NULL; |
port_to_connect = listen_port = 0; |
port_to_connect = listen_port = 0; |
if (fwd->connect_path != NULL) { |
if (fwd->connect_path != NULL) { |
host_to_connect = xstrdup(fwd->connect_path); |
host_to_connect = fwd->connect_path; |
port_to_connect = PORT_STREAMLOCAL; |
port_to_connect = PORT_STREAMLOCAL; |
} else { |
} else { |
host_to_connect = xstrdup(fwd->connect_host); |
host_to_connect = fwd->connect_host; |
port_to_connect = fwd->connect_port; |
port_to_connect = fwd->connect_port; |
} |
} |
if (fwd->listen_path != NULL) { |
if (fwd->listen_path != NULL) { |
listen_path = xstrdup(fwd->listen_path); |
listen_path = fwd->listen_path; |
listen_port = PORT_STREAMLOCAL; |
listen_port = PORT_STREAMLOCAL; |
} else { |
} else { |
if (fwd->listen_host != NULL) |
listen_host = fwd->listen_host; |
listen_host = xstrdup(fwd->listen_host); |
|
listen_port = fwd->listen_port; |
listen_port = fwd->listen_port; |
} |
} |
idx = permission_set_add(ssh, FORWARD_USER, FORWARD_LOCAL, |
idx = permission_set_add(ssh, FORWARD_USER, FORWARD_LOCAL, |