summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/monitor.c b/monitor.c
index 3f468dfff..b7463400e 100644
--- a/monitor.c
+++ b/monitor.c
@@ -25,7 +25,7 @@
25 */ 25 */
26 26
27#include "includes.h" 27#include "includes.h"
28RCSID("$OpenBSD: monitor.c,v 1.60 2004/06/22 05:05:45 dtucker Exp $"); 28RCSID("$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[];
79extern Buffer input, output; 79extern Buffer input, output;
80extern Buffer auth_debug; 80extern Buffer auth_debug;
81extern int auth_debug_init; 81extern int auth_debug_init;
82extern 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));