diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 10 |
1 files changed, 5 insertions, 5 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.198 2019/06/28 13:35:04 deraadt 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> |
@@ -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]); |