diff options
Diffstat (limited to 'session.c')
-rw-r--r-- | session.c | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -8,7 +8,7 @@ | |||
8 | */ | 8 | */ |
9 | 9 | ||
10 | #include "includes.h" | 10 | #include "includes.h" |
11 | RCSID("$OpenBSD: session.c,v 1.2 2000/04/06 08:55:22 markus Exp $"); | 11 | RCSID("$OpenBSD: session.c,v 1.4 2000/04/14 10:30:33 markus Exp $"); |
12 | 12 | ||
13 | #include "xmalloc.h" | 13 | #include "xmalloc.h" |
14 | #include "ssh.h" | 14 | #include "ssh.h" |
@@ -113,7 +113,7 @@ xauthfile_cleanup_proc(void *ignore) | |||
113 | * Function to perform cleanup if we get aborted abnormally (e.g., due to a | 113 | * Function to perform cleanup if we get aborted abnormally (e.g., due to a |
114 | * dropped connection). | 114 | * dropped connection). |
115 | */ | 115 | */ |
116 | void | 116 | void |
117 | pty_cleanup_proc(void *session) | 117 | pty_cleanup_proc(void *session) |
118 | { | 118 | { |
119 | Session *s=session; | 119 | Session *s=session; |
@@ -136,7 +136,7 @@ pty_cleanup_proc(void *session) | |||
136 | * terminals are allocated, X11, TCP/IP, and authentication agent forwardings | 136 | * terminals are allocated, X11, TCP/IP, and authentication agent forwardings |
137 | * are requested, etc. | 137 | * are requested, etc. |
138 | */ | 138 | */ |
139 | void | 139 | void |
140 | do_authenticated(struct passwd * pw) | 140 | do_authenticated(struct passwd * pw) |
141 | { | 141 | { |
142 | Session *s; | 142 | Session *s; |
@@ -366,7 +366,7 @@ do_authenticated(struct passwd * pw) | |||
366 | * will call do_child from the child, and server_loop from the parent after | 366 | * will call do_child from the child, and server_loop from the parent after |
367 | * setting up file descriptors and such. | 367 | * setting up file descriptors and such. |
368 | */ | 368 | */ |
369 | void | 369 | void |
370 | do_exec_no_pty(Session *s, const char *command, struct passwd * pw) | 370 | do_exec_no_pty(Session *s, const char *command, struct passwd * pw) |
371 | { | 371 | { |
372 | int pid; | 372 | int pid; |
@@ -487,7 +487,7 @@ do_exec_no_pty(Session *s, const char *command, struct passwd * pw) | |||
487 | * setting up file descriptors, controlling tty, updating wtmp, utmp, | 487 | * setting up file descriptors, controlling tty, updating wtmp, utmp, |
488 | * lastlog, and other such operations. | 488 | * lastlog, and other such operations. |
489 | */ | 489 | */ |
490 | void | 490 | void |
491 | do_exec_pty(Session *s, const char *command, struct passwd * pw) | 491 | do_exec_pty(Session *s, const char *command, struct passwd * pw) |
492 | { | 492 | { |
493 | FILE *f; | 493 | FILE *f; |
@@ -660,7 +660,7 @@ do_exec_pty(Session *s, const char *command, struct passwd * pw) | |||
660 | * Sets the value of the given variable in the environment. If the variable | 660 | * Sets the value of the given variable in the environment. If the variable |
661 | * already exists, its value is overriden. | 661 | * already exists, its value is overriden. |
662 | */ | 662 | */ |
663 | void | 663 | void |
664 | child_set_env(char ***envp, unsigned int *envsizep, const char *name, | 664 | child_set_env(char ***envp, unsigned int *envsizep, const char *name, |
665 | const char *value) | 665 | const char *value) |
666 | { | 666 | { |
@@ -701,7 +701,7 @@ child_set_env(char ***envp, unsigned int *envsizep, const char *name, | |||
701 | * Otherwise, it must consist of empty lines, comments (line starts with '#') | 701 | * Otherwise, it must consist of empty lines, comments (line starts with '#') |
702 | * and assignments of the form name=value. No other forms are allowed. | 702 | * and assignments of the form name=value. No other forms are allowed. |
703 | */ | 703 | */ |
704 | void | 704 | void |
705 | read_environment_file(char ***env, unsigned int *envsize, | 705 | read_environment_file(char ***env, unsigned int *envsize, |
706 | const char *filename) | 706 | const char *filename) |
707 | { | 707 | { |
@@ -770,7 +770,7 @@ void do_pam_environment(char ***env, int *envsize) | |||
770 | * environment, closing extra file descriptors, setting the user and group | 770 | * environment, closing extra file descriptors, setting the user and group |
771 | * ids, and executing the command or shell. | 771 | * ids, and executing the command or shell. |
772 | */ | 772 | */ |
773 | void | 773 | void |
774 | do_child(const char *command, struct passwd * pw, const char *term, | 774 | do_child(const char *command, struct passwd * pw, const char *term, |
775 | const char *display, const char *auth_proto, | 775 | const char *display, const char *auth_proto, |
776 | const char *auth_data, const char *ttyname) | 776 | const char *auth_data, const char *ttyname) |
@@ -1202,6 +1202,7 @@ session_window_change_req(Session *s) | |||
1202 | s->row = packet_get_int(); | 1202 | s->row = packet_get_int(); |
1203 | s->xpixel = packet_get_int(); | 1203 | s->xpixel = packet_get_int(); |
1204 | s->ypixel = packet_get_int(); | 1204 | s->ypixel = packet_get_int(); |
1205 | packet_done(); | ||
1205 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); | 1206 | pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel); |
1206 | return 1; | 1207 | return 1; |
1207 | } | 1208 | } |
@@ -1210,14 +1211,17 @@ int | |||
1210 | session_pty_req(Session *s) | 1211 | session_pty_req(Session *s) |
1211 | { | 1212 | { |
1212 | unsigned int len; | 1213 | unsigned int len; |
1214 | char *term_modes; /* encoded terminal modes */ | ||
1213 | 1215 | ||
1214 | if (s->ttyfd != -1) | 1216 | if (s->ttyfd != -1) |
1215 | return -1; | 1217 | return 0; |
1216 | s->term = packet_get_string(&len); | 1218 | s->term = packet_get_string(&len); |
1217 | s->col = packet_get_int(); | 1219 | s->col = packet_get_int(); |
1218 | s->row = packet_get_int(); | 1220 | s->row = packet_get_int(); |
1219 | s->xpixel = packet_get_int(); | 1221 | s->xpixel = packet_get_int(); |
1220 | s->ypixel = packet_get_int(); | 1222 | s->ypixel = packet_get_int(); |
1223 | term_modes = packet_get_string(&len); | ||
1224 | packet_done(); | ||
1221 | 1225 | ||
1222 | if (strcmp(s->term, "") == 0) { | 1226 | if (strcmp(s->term, "") == 0) { |
1223 | xfree(s->term); | 1227 | xfree(s->term); |
@@ -1230,7 +1234,8 @@ session_pty_req(Session *s) | |||
1230 | s->ptyfd = -1; | 1234 | s->ptyfd = -1; |
1231 | s->ttyfd = -1; | 1235 | s->ttyfd = -1; |
1232 | error("session_pty_req: session %d alloc failed", s->self); | 1236 | error("session_pty_req: session %d alloc failed", s->self); |
1233 | return -1; | 1237 | xfree(term_modes); |
1238 | return 0; | ||
1234 | } | 1239 | } |
1235 | debug("session_pty_req: session %d alloc %s", s->self, s->tty); | 1240 | debug("session_pty_req: session %d alloc %s", s->self, s->tty); |
1236 | /* | 1241 | /* |