[openssh-commits] [openssh] 01/01: upstream: check for POLLHUP wherever we check for POLLIN

git+noreply at mindrot.org git+noreply at mindrot.org
Thu Nov 18 14:33:07 AEDT 2021


This is an automated email from the git hooks/post-receive script.

djm pushed a commit to branch master
in repository openssh.

commit 875408270c5a7dd69ed5449e5d85bd7120c88f70
Author: djm at openbsd.org <djm at openbsd.org>
Date:   Thu Nov 18 03:31:44 2021 +0000

    upstream: check for POLLHUP wherever we check for POLLIN
    
    OpenBSD-Commit-ID: 6aa6f3ec6b17c3bd9bfec672a917f003a76d93e5
---
 ssh-agent.c         | 7 +++----
 ssh-keyscan.c       | 4 ++--
 ssh-pkcs11-helper.c | 4 ++--
 3 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/ssh-agent.c b/ssh-agent.c
index 48a47d45..521921fa 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-agent.c,v 1.278 2021/04/03 06:18:41 djm Exp $ */
+/* $OpenBSD: ssh-agent.c,v 1.279 2021/11/18 03:31:44 djm Exp $ */
 /*
  * Author: Tatu Ylonen <ylo at cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo at cs.hut.fi>, Espoo, Finland
@@ -1214,10 +1214,9 @@ after_poll(struct pollfd *pfd, size_t npfd, u_int maxfds)
 				activefds++;
 			break;
 		case AUTH_CONNECTION:
-			if ((pfd[i].revents & (POLLIN|POLLERR)) != 0 &&
-			    handle_conn_read(socknum) != 0) {
+			if ((pfd[i].revents & (POLLIN|POLLHUP|POLLERR)) != 0 &&
+			    handle_conn_read(socknum) != 0)
 				goto close_sock;
-			}
 			if ((pfd[i].revents & (POLLOUT|POLLHUP)) != 0 &&
 			    handle_conn_write(socknum) != 0) {
  close_sock:
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index b0c530f3..ccd21258 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-keyscan.c,v 1.142 2021/11/12 05:23:49 deraadt Exp $ */
+/* $OpenBSD: ssh-keyscan.c,v 1.143 2021/11/18 03:31:44 djm Exp $ */
 /*
  * Copyright 1995, 1996 by David Mazieres <dm at lcs.mit.edu>.
  *
@@ -597,7 +597,7 @@ conloop(void)
 	for (i = 0; i < maxfd; i++) {
 		if (read_wait[i].revents & (POLLHUP|POLLERR|POLLNVAL))
 			confree(i);
-		else if (read_wait[i].revents & POLLIN)
+		else if (read_wait[i].revents & (POLLIN|POLLHUP))
 			conread(i);
 	}
 
diff --git a/ssh-pkcs11-helper.c b/ssh-pkcs11-helper.c
index 5ca8d03f..5c3eaaeb 100644
--- a/ssh-pkcs11-helper.c
+++ b/ssh-pkcs11-helper.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11-helper.c,v 1.25 2021/08/11 05:20:17 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11-helper.c,v 1.26 2021/11/18 03:31:44 djm Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  *
@@ -385,7 +385,7 @@ main(int argc, char **argv)
 		}
 
 		/* copy stdin to iqueue */
-		if ((pfd[0].revents & (POLLIN|POLLERR)) != 0) {
+		if ((pfd[0].revents & (POLLIN|POLLHUP|POLLERR)) != 0) {
 			len = read(in, buf, sizeof buf);
 			if (len == 0) {
 				debug("read eof");

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list