diff options
Diffstat (limited to 'channels.c')
-rw-r--r-- | channels.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/channels.c b/channels.c index 328a11781..8d6d87ae3 100644 --- a/channels.c +++ b/channels.c | |||
@@ -16,7 +16,7 @@ | |||
16 | */ | 16 | */ |
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | RCSID("$Id: channels.c,v 1.11 1999/12/07 05:47:28 damien Exp $"); | 19 | RCSID("$Id: channels.c,v 1.12 1999/12/13 23:47:15 damien Exp $"); |
20 | 20 | ||
21 | #include "ssh.h" | 21 | #include "ssh.h" |
22 | #include "packet.h" | 22 | #include "packet.h" |
@@ -877,11 +877,10 @@ channel_open_message() | |||
877 | 877 | ||
878 | void | 878 | void |
879 | channel_request_local_forwarding(u_short port, const char *host, | 879 | channel_request_local_forwarding(u_short port, const char *host, |
880 | u_short host_port) | 880 | u_short host_port, int gateway_ports) |
881 | { | 881 | { |
882 | int ch, sock, on = 1; | 882 | int ch, sock, on = 1; |
883 | struct sockaddr_in sin; | 883 | struct sockaddr_in sin; |
884 | extern Options options; | ||
885 | struct linger linger; | 884 | struct linger linger; |
886 | 885 | ||
887 | if (strlen(host) > sizeof(channels[0].path) - 1) | 886 | if (strlen(host) > sizeof(channels[0].path) - 1) |
@@ -895,7 +894,7 @@ channel_request_local_forwarding(u_short port, const char *host, | |||
895 | /* Initialize socket address. */ | 894 | /* Initialize socket address. */ |
896 | memset(&sin, 0, sizeof(sin)); | 895 | memset(&sin, 0, sizeof(sin)); |
897 | sin.sin_family = AF_INET; | 896 | sin.sin_family = AF_INET; |
898 | if (options.gateway_ports == 1) | 897 | if (gateway_ports == 1) |
899 | sin.sin_addr.s_addr = htonl(INADDR_ANY); | 898 | sin.sin_addr.s_addr = htonl(INADDR_ANY); |
900 | else | 899 | else |
901 | sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); | 900 | sin.sin_addr.s_addr = htonl(INADDR_LOOPBACK); |
@@ -983,9 +982,11 @@ channel_input_port_forward_request(int is_root) | |||
983 | if (port < IPPORT_RESERVED && !is_root) | 982 | if (port < IPPORT_RESERVED && !is_root) |
984 | packet_disconnect("Requested forwarding of port %d but user is not root.", | 983 | packet_disconnect("Requested forwarding of port %d but user is not root.", |
985 | port); | 984 | port); |
986 | 985 | /* | |
987 | /* Initiate forwarding. */ | 986 | * Initiate forwarding, |
988 | channel_request_local_forwarding(port, hostname, host_port); | 987 | * bind port to localhost only (gateway ports == 0). |
988 | */ | ||
989 | channel_request_local_forwarding(port, hostname, host_port, 0); | ||
989 | 990 | ||
990 | /* Free the argument string. */ | 991 | /* Free the argument string. */ |
991 | xfree(hostname); | 992 | xfree(hostname); |
@@ -1116,16 +1117,15 @@ fail: | |||
1116 | */ | 1117 | */ |
1117 | 1118 | ||
1118 | char * | 1119 | char * |
1119 | x11_create_display_inet(int screen_number) | 1120 | x11_create_display_inet(int screen_number, int x11_display_offset) |
1120 | { | 1121 | { |
1121 | extern ServerOptions options; | ||
1122 | int display_number, sock; | 1122 | int display_number, sock; |
1123 | u_short port; | 1123 | u_short port; |
1124 | struct sockaddr_in sin; | 1124 | struct sockaddr_in sin; |
1125 | char buf[512]; | 1125 | char buf[512]; |
1126 | char hostname[MAXHOSTNAMELEN]; | 1126 | char hostname[MAXHOSTNAMELEN]; |
1127 | 1127 | ||
1128 | for (display_number = options.x11_display_offset; | 1128 | for (display_number = x11_display_offset; |
1129 | display_number < MAX_DISPLAYS; | 1129 | display_number < MAX_DISPLAYS; |
1130 | display_number++) { | 1130 | display_number++) { |
1131 | port = 6000 + display_number; | 1131 | port = 6000 + display_number; |