summaryrefslogtreecommitdiff
path: root/monitor_wrap.c
diff options
context:
space:
mode:
authormarkus@openbsd.org <markus@openbsd.org>2018-07-09 21:26:02 +0000
committerDamien Miller <djm@mindrot.org>2018-07-10 15:21:58 +1000
commit2808d18ca47ad3d251836c555f0e22aaca03d15c (patch)
tree06bc9605dd843d77ee25187637e348369e59cb1d /monitor_wrap.c
parent89dd615b8b531979be63f05f9d5624367c9b28e6 (diff)
upstream: sshd: switch loginmsg to sshbuf API; ok djm@
OpenBSD-Commit-ID: f3cb4e54bff15c593602d95cc43e32ee1a4bac42
Diffstat (limited to 'monitor_wrap.c')
-rw-r--r--monitor_wrap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/monitor_wrap.c b/monitor_wrap.c
index 012ab01a9..6bf041093 100644
--- a/monitor_wrap.c
+++ b/monitor_wrap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor_wrap.c,v 1.101 2018/07/09 13:37:10 sf Exp $ */ 1/* $OpenBSD: monitor_wrap.c,v 1.102 2018/07/09 21:26:02 markus Exp $ */
2/* 2/*
3 * Copyright 2002 Niels Provos <provos@citi.umich.edu> 3 * Copyright 2002 Niels Provos <provos@citi.umich.edu>
4 * Copyright 2002 Markus Friedl <markus@openbsd.org> 4 * Copyright 2002 Markus Friedl <markus@openbsd.org>
@@ -87,7 +87,7 @@
87extern z_stream incoming_stream; 87extern z_stream incoming_stream;
88extern z_stream outgoing_stream; 88extern z_stream outgoing_stream;
89extern struct monitor *pmonitor; 89extern struct monitor *pmonitor;
90extern Buffer loginmsg; 90extern struct sshbuf *loginmsg;
91extern ServerOptions options; 91extern ServerOptions options;
92 92
93void 93void
@@ -506,7 +506,7 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
506{ 506{
507 Buffer m; 507 Buffer m;
508 char *p, *msg; 508 char *p, *msg;
509 int success = 0, tmp1 = -1, tmp2 = -1; 509 int success = 0, tmp1 = -1, tmp2 = -1, r;
510 510
511 /* Kludge: ensure there are fds free to receive the pty/tty */ 511 /* Kludge: ensure there are fds free to receive the pty/tty */
512 if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 || 512 if ((tmp1 = dup(pmonitor->m_recvfd)) == -1 ||
@@ -540,7 +540,8 @@ mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen)
540 strlcpy(namebuf, p, namebuflen); /* Possible truncation */ 540 strlcpy(namebuf, p, namebuflen); /* Possible truncation */
541 free(p); 541 free(p);
542 542
543 buffer_append(&loginmsg, msg, strlen(msg)); 543 if ((r = sshbuf_put(loginmsg, msg, strlen(msg))) != 0)
544 fatal("%s: buffer error: %s", __func__, ssh_err(r));
544 free(msg); 545 free(msg);
545 546
546 if ((*ptyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1 || 547 if ((*ptyfd = mm_receive_fd(pmonitor->m_recvfd)) == -1 ||