diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: monitor.c,v 1.60 2004/06/22 05:05:45 dtucker Exp $"); | 28 | RCSID("$OpenBSD: monitor.c,v 1.61 2004/07/17 05:31:41 dtucker Exp $"); |
29 | 29 | ||
30 | #include <openssl/dh.h> | 30 | #include <openssl/dh.h> |
31 | 31 | ||
@@ -79,6 +79,7 @@ extern u_char session_id[]; | |||
79 | extern Buffer input, output; | 79 | extern Buffer input, output; |
80 | extern Buffer auth_debug; | 80 | extern Buffer auth_debug; |
81 | extern int auth_debug_init; | 81 | extern int auth_debug_init; |
82 | extern Buffer loginmsg; | ||
82 | 83 | ||
83 | /* State exported from the child */ | 84 | /* State exported from the child */ |
84 | 85 | ||
@@ -1230,10 +1231,6 @@ mm_answer_pty(int sock, Buffer *m) | |||
1230 | 1231 | ||
1231 | buffer_put_int(m, 1); | 1232 | buffer_put_int(m, 1); |
1232 | buffer_put_cstring(m, s->tty); | 1233 | buffer_put_cstring(m, s->tty); |
1233 | mm_request_send(sock, MONITOR_ANS_PTY, m); | ||
1234 | |||
1235 | mm_send_fd(sock, s->ptyfd); | ||
1236 | mm_send_fd(sock, s->ttyfd); | ||
1237 | 1234 | ||
1238 | /* We need to trick ttyslot */ | 1235 | /* We need to trick ttyslot */ |
1239 | if (dup2(s->ttyfd, 0) == -1) | 1236 | if (dup2(s->ttyfd, 0) == -1) |
@@ -1244,6 +1241,15 @@ mm_answer_pty(int sock, Buffer *m) | |||
1244 | /* Now we can close the file descriptor again */ | 1241 | /* Now we can close the file descriptor again */ |
1245 | close(0); | 1242 | close(0); |
1246 | 1243 | ||
1244 | /* send messages generated by record_login */ | ||
1245 | buffer_put_string(m, buffer_ptr(&loginmsg), buffer_len(&loginmsg)); | ||
1246 | buffer_clear(&loginmsg); | ||
1247 | |||
1248 | mm_request_send(sock, MONITOR_ANS_PTY, m); | ||
1249 | |||
1250 | mm_send_fd(sock, s->ptyfd); | ||
1251 | mm_send_fd(sock, s->ttyfd); | ||
1252 | |||
1247 | /* make sure nothing uses fd 0 */ | 1253 | /* make sure nothing uses fd 0 */ |
1248 | if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) | 1254 | if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) |
1249 | fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); | 1255 | fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); |