version 1.2, 2000/04/06 08:55:22 |
version 1.3, 2000/04/14 10:09:16 |
|
|
s->row = packet_get_int(); |
s->row = packet_get_int(); |
s->xpixel = packet_get_int(); |
s->xpixel = packet_get_int(); |
s->ypixel = packet_get_int(); |
s->ypixel = packet_get_int(); |
|
packet_done(); |
pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
return 1; |
return 1; |
} |
} |
|
|
session_pty_req(Session *s) |
session_pty_req(Session *s) |
{ |
{ |
unsigned int len; |
unsigned int len; |
|
char *term_modes; /* encoded terminal modes */ |
|
|
if (s->ttyfd != -1) |
if (s->ttyfd != -1) |
return -1; |
return 0; |
s->term = packet_get_string(&len); |
s->term = packet_get_string(&len); |
s->col = packet_get_int(); |
s->col = packet_get_int(); |
s->row = packet_get_int(); |
s->row = packet_get_int(); |
s->xpixel = packet_get_int(); |
s->xpixel = packet_get_int(); |
s->ypixel = packet_get_int(); |
s->ypixel = packet_get_int(); |
|
term_modes = packet_get_string(&len); |
|
packet_done(); |
|
|
if (strcmp(s->term, "") == 0) { |
if (strcmp(s->term, "") == 0) { |
xfree(s->term); |
xfree(s->term); |
|
|
s->ptyfd = -1; |
s->ptyfd = -1; |
s->ttyfd = -1; |
s->ttyfd = -1; |
error("session_pty_req: session %d alloc failed", s->self); |
error("session_pty_req: session %d alloc failed", s->self); |
return -1; |
xfree(term_modes); |
|
return 0; |
} |
} |
debug("session_pty_req: session %d alloc %s", s->self, s->tty); |
debug("session_pty_req: session %d alloc %s", s->self, s->tty); |
/* |
/* |
|
|
/* Get window size from the packet. */ |
/* Get window size from the packet. */ |
pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
|
|
|
/* XXX parse and set terminal modes */ |
|
xfree(term_modes); |
return 1; |
return 1; |
} |
} |
|
|
|
|
*/ |
*/ |
if (c->type == SSH_CHANNEL_LARVAL) { |
if (c->type == SSH_CHANNEL_LARVAL) { |
if (strcmp(rtype, "shell") == 0) { |
if (strcmp(rtype, "shell") == 0) { |
|
packet_done(); |
if (s->ttyfd == -1) |
if (s->ttyfd == -1) |
do_exec_no_pty(s, NULL, s->pw); |
do_exec_no_pty(s, NULL, s->pw); |
else |
else |
|
|
success = 1; |
success = 1; |
} else if (strcmp(rtype, "exec") == 0) { |
} else if (strcmp(rtype, "exec") == 0) { |
char *command = packet_get_string(&len); |
char *command = packet_get_string(&len); |
|
packet_done(); |
if (s->ttyfd == -1) |
if (s->ttyfd == -1) |
do_exec_no_pty(s, command, s->pw); |
do_exec_no_pty(s, command, s->pw); |
else |
else |
|
|
xfree(command); |
xfree(command); |
success = 1; |
success = 1; |
} else if (strcmp(rtype, "pty-req") == 0) { |
} else if (strcmp(rtype, "pty-req") == 0) { |
if (session_pty_req(s) > 0) |
success = session_pty_req(s); |
success = 1; |
|
} |
} |
} |
} |
if (strcmp(rtype, "window-change") == 0) { |
if (strcmp(rtype, "window-change") == 0) { |