version 1.147, 2001/12/08 17:49:28 |
version 1.148, 2001/12/19 07:18:56 |
|
|
data_len = ucp[8] + 256 * ucp[9]; |
data_len = ucp[8] + 256 * ucp[9]; |
} else { |
} else { |
debug("Initial X11 packet contains bad byte order byte: 0x%x", |
debug("Initial X11 packet contains bad byte order byte: 0x%x", |
ucp[0]); |
ucp[0]); |
return -1; |
return -1; |
} |
} |
|
|
|
|
{ |
{ |
u_char *p, *host; |
u_char *p, *host; |
int len, have, i, found; |
int len, have, i, found; |
char username[256]; |
char username[256]; |
struct { |
struct { |
u_int8_t version; |
u_int8_t version; |
u_int8_t command; |
u_int8_t command; |
|
|
host = inet_ntoa(s4_req.dest_addr); |
host = inet_ntoa(s4_req.dest_addr); |
strlcpy(c->path, host, sizeof(c->path)); |
strlcpy(c->path, host, sizeof(c->path)); |
c->host_port = ntohs(s4_req.dest_port); |
c->host_port = ntohs(s4_req.dest_port); |
|
|
debug("channel %d: dynamic request: socks4 host %s port %u command %u", |
debug("channel %d: dynamic request: socks4 host %s port %u command %u", |
c->self, host, c->host_port, s4_req.command); |
c->self, host, c->host_port, s4_req.command); |
|
|
|
|
FD_ISSET(c->efd, readset)) { |
FD_ISSET(c->efd, readset)) { |
len = read(c->efd, buf, sizeof(buf)); |
len = read(c->efd, buf, sizeof(buf)); |
debug2("channel %d: read %d from efd %d", |
debug2("channel %d: read %d from efd %d", |
c->self, len, c->efd); |
c->self, len, c->efd); |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
if (len < 0 && (errno == EINTR || errno == EAGAIN)) |
return 1; |
return 1; |
if (len <= 0) { |
if (len <= 0) { |
|
|
channel_handler_init(void) |
channel_handler_init(void) |
{ |
{ |
int i; |
int i; |
for(i = 0; i < SSH_CHANNEL_MAX_TYPE; i++) { |
for (i = 0; i < SSH_CHANNEL_MAX_TYPE; i++) { |
channel_pre[i] = NULL; |
channel_pre[i] = NULL; |
channel_post[i] = NULL; |
channel_post[i] = NULL; |
} |
} |
|
|
int gaierr, n, num_socks = 0, socks[NUM_SOCKS]; |
int gaierr, n, num_socks = 0, socks[NUM_SOCKS]; |
|
|
for (display_number = x11_display_offset; |
for (display_number = x11_display_offset; |
display_number < MAX_DISPLAYS; |
display_number < MAX_DISPLAYS; |
display_number++) { |
display_number++) { |
port = 6000 + display_number; |
port = 6000 + display_number; |
memset(&hints, 0, sizeof(hints)); |
memset(&hints, 0, sizeof(hints)); |
hints.ai_family = IPv4or6; |
hints.ai_family = IPv4or6; |
|
|
/* Connect to the unix domain socket. */ |
/* Connect to the unix domain socket. */ |
if (sscanf(strrchr(display, ':') + 1, "%d", &display_number) != 1) { |
if (sscanf(strrchr(display, ':') + 1, "%d", &display_number) != 1) { |
error("Could not parse display number from DISPLAY: %.100s", |
error("Could not parse display number from DISPLAY: %.100s", |
display); |
display); |
return -1; |
return -1; |
} |
} |
/* Create a socket. */ |
/* Create a socket. */ |
|
|
/* buf now contains the host name. But first we parse the display number. */ |
/* buf now contains the host name. But first we parse the display number. */ |
if (sscanf(cp + 1, "%d", &display_number) != 1) { |
if (sscanf(cp + 1, "%d", &display_number) != 1) { |
error("Could not parse display number from DISPLAY: %.100s", |
error("Could not parse display number from DISPLAY: %.100s", |
display); |
display); |
return -1; |
return -1; |
} |
} |
|
|