diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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> |
@@ -692,7 +692,7 @@ mm_answer_sign(struct ssh *ssh, int sock, struct sshbuf *m) | |||
692 | fatal("%s: no hostkey from index %d", __func__, keyid); | 692 | fatal("%s: no hostkey from index %d", __func__, keyid); |
693 | 693 | ||
694 | debug3("%s: %s signature %p(%zu)", __func__, | 694 | debug3("%s: %s signature %p(%zu)", __func__, |
695 | is_proof ? "KEX" : "hostkey proof", signature, siglen); | 695 | is_proof ? "hostkey proof" : "KEX", signature, siglen); |
696 | 696 | ||
697 | sshbuf_reset(m); | 697 | sshbuf_reset(m); |
698 | if ((r = sshbuf_put_string(m, signature, siglen)) != 0) | 698 | if ((r = sshbuf_put_string(m, signature, siglen)) != 0) |
@@ -1470,7 +1470,7 @@ mm_record_login(struct ssh *ssh, Session *s, struct passwd *pw) | |||
1470 | fromlen = sizeof(from); | 1470 | fromlen = sizeof(from); |
1471 | if (ssh_packet_connection_is_on_socket(ssh)) { | 1471 | if (ssh_packet_connection_is_on_socket(ssh)) { |
1472 | if (getpeername(ssh_packet_get_connection_in(ssh), | 1472 | if (getpeername(ssh_packet_get_connection_in(ssh), |
1473 | (struct sockaddr *)&from, &fromlen) < 0) { | 1473 | (struct sockaddr *)&from, &fromlen) == -1) { |
1474 | debug("getpeername: %.100s", strerror(errno)); | 1474 | debug("getpeername: %.100s", strerror(errno)); |
1475 | cleanup_exit(255); | 1475 | cleanup_exit(255); |
1476 | } | 1476 | } |
@@ -1538,7 +1538,7 @@ mm_answer_pty(struct ssh *ssh, int sock, struct sshbuf *m) | |||
1538 | fatal("%s: send fds failed", __func__); | 1538 | fatal("%s: send fds failed", __func__); |
1539 | 1539 | ||
1540 | /* make sure nothing uses fd 0 */ | 1540 | /* make sure nothing uses fd 0 */ |
1541 | if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) < 0) | 1541 | if ((fd0 = open(_PATH_DEVNULL, O_RDONLY)) == -1) |
1542 | fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); | 1542 | fatal("%s: open(/dev/null): %s", __func__, strerror(errno)); |
1543 | if (fd0 != 0) | 1543 | if (fd0 != 0) |
1544 | error("%s: fd0 %d != 0", __func__, fd0); | 1544 | error("%s: fd0 %d != 0", __func__, fd0); |
@@ -1730,9 +1730,9 @@ monitor_openfds(struct monitor *mon, int do_logfds) | |||
1730 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) | 1730 | if (socketpair(AF_UNIX, SOCK_STREAM, 0, pair) == -1) |
1731 | fatal("%s: socketpair: %s", __func__, strerror(errno)); | 1731 | fatal("%s: socketpair: %s", __func__, strerror(errno)); |
1732 | #ifdef SO_ZEROIZE | 1732 | #ifdef SO_ZEROIZE |
1733 | if (setsockopt(pair[0], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) < 0) | 1733 | if (setsockopt(pair[0], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) == -1) |
1734 | error("setsockopt SO_ZEROIZE(0): %.100s", strerror(errno)); | 1734 | error("setsockopt SO_ZEROIZE(0): %.100s", strerror(errno)); |
1735 | if (setsockopt(pair[1], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) < 0) | 1735 | if (setsockopt(pair[1], SOL_SOCKET, SO_ZEROIZE, &on, sizeof(on)) == -1) |
1736 | error("setsockopt SO_ZEROIZE(1): %.100s", strerror(errno)); | 1736 | error("setsockopt SO_ZEROIZE(1): %.100s", strerror(errno)); |
1737 | #endif | 1737 | #endif |
1738 | FD_CLOSEONEXEC(pair[0]); | 1738 | FD_CLOSEONEXEC(pair[0]); |