summaryrefslogtreecommitdiff
path: root/monitor.c
diff options
context:
space:
mode:
Diffstat (limited to 'monitor.c')
-rw-r--r--monitor.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/monitor.c b/monitor.c
index 5f84e880d..04db44c9c 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: monitor.c,v 1.197 2019/01/21 10:38:54 djm Exp $ */ 1/* $OpenBSD: monitor.c,v 1.199 2019/10/07 23:10:38 djm 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>
@@ -40,7 +40,7 @@
40#include <pwd.h> 40#include <pwd.h>
41#include <signal.h> 41#include <signal.h>
42#ifdef HAVE_STDINT_H 42#ifdef HAVE_STDINT_H
43#include <stdint.h> 43# include <stdint.h>
44#endif 44#endif
45#include <stdlib.h> 45#include <stdlib.h>
46#include <string.h> 46#include <string.h>
@@ -711,7 +711,7 @@ mm_answer_sign(struct ssh *ssh, int sock, struct sshbuf *m)
711 fatal("%s: no hostkey from index %d", __func__, keyid); 711 fatal("%s: no hostkey from index %d", __func__, keyid);
712 712
713 debug3("%s: %s signature %p(%zu)", __func__, 713 debug3("%s: %s signature %p(%zu)", __func__,
714 is_proof ? "KEX" : "hostkey proof", signature, siglen); 714 is_proof ? "hostkey proof" : "KEX", signature, siglen);
715 715
716 sshbuf_reset(m); 716 sshbuf_reset(m);
717 if ((r = sshbuf_put_string(m, signature, siglen)) != 0) 717 if ((r = sshbuf_put_string(m, signature, siglen)) != 0)
@@ -1516,7 +1516,7 @@ mm_record_login(struct ssh *ssh, Session *s, struct passwd *pw)
1516 fromlen = sizeof(from); 1516 fromlen = sizeof(from);
1517 if (ssh_packet_connection_is_on_socket(ssh)) { 1517 if (ssh_packet_connection_is_on_socket(ssh)) {
1518 if (getpeername(ssh_packet_get_connection_in(ssh), 1518 if (getpeername(ssh_packet_get_connection_in(ssh),
1519 (struct sockaddr *)&from, &fromlen) < 0) { 1519 (struct sockaddr *)&from, &fromlen) == -1) {
1520 debug("getpeername: %.100s", strerror(errno)); 1520 debug("getpeername: %.100s", strerror(errno));
1521 cleanup_exit(255); 1521 cleanup_exit(255);
1522 } 1522 }
@@ -1584,7 +1584,7 @@ mm_answer_pty(struct ssh *ssh, int sock, struct sshbuf *m)
1584 fatal("%s: send fds failed", __func__); 1584 fatal("%s: send fds failed", __func__);
1585 1585
1586 /* make sure nothing uses fd 0 */ 1586 /* make sure nothing uses fd 0 */
1587 if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) 1587 if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) == -1)
1588 fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); 1588 fatal("%s: open(/dev/null): %s", __func__, strerror(errno));
1589 if (fd0 != 0) 1589 if (fd0 != 0)
1590 error("%s: fd0 %d != 0", __func__, fd0); 1590 error("%s: fd0 %d != 0", __func__, fd0);
@@ -1787,9 +1787,9 @@ monitor_openfds(struct monitor *mon, int do_logfds)
1787 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) 1787 if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1)
1788 fatal("%s: socketpair: %s", __func__, strerror(errno)); 1788 fatal("%s: socketpair: %s", __func__, strerror(errno));
1789#ifdef SO_ZEROIZE 1789#ifdef SO_ZEROIZE
1790 if (setsockopt(pair[0], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) < 0) 1790 if (setsockopt(pair[0], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) == -1)
1791 error("setsockopt SO_ZEROIZE(0): %.100s", strerror(errno)); 1791 error("setsockopt SO_ZEROIZE(0): %.100s", strerror(errno));
1792 if (setsockopt(pair[1], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) < 0) 1792 if (setsockopt(pair[1], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) == -1)
1793 error("setsockopt SO_ZEROIZE(1): %.100s", strerror(errno)); 1793 error("setsockopt SO_ZEROIZE(1): %.100s", strerror(errno));
1794#endif 1794#endif
1795 FD_CLOSEONEXEC(pair[0]); 1795 FD_CLOSEONEXEC(pair[0]);