Problem with latest OpenSSH - 2.5.2p2

Damien Miller djm at mindrot.org
Sat Apr 14 00:11:39 EST 2001


On Thu, 12 Apr 2001, Lutz Jaenicke wrote:

> I just did a grep on 'read:' and there is only one place where this error
> could be generated. It is in clientloop.c:client_process_input().

[snip]

> There is no check for EINTR (and EAGAIN), and the occurance of EINTR
> would be treated as error.

Does this work?

Index: clientloop.c
===================================================================
RCS file: /cvs/src/usr.bin/ssh/clientloop.c,v
retrieving revision 1.61
diff -u -r1.61 clientloop.c
--- clientloop.c	2001/04/08 11:27:33	1.61
+++ clientloop.c	2001/04/13 14:07:41
@@ -671,7 +671,9 @@
 	/* Read input from stdin. */
 	if (FD_ISSET(fileno(stdin), readset)) {
 		/* Read as much as possible. */
-		len = read(fileno(stdin), buf, sizeof(buf));
+		do
+			len = read(fileno(stdin), buf, sizeof(buf));
+		while (len == -1 && (errno == EINTR || errno == EAGAIN));
 		if (len <= 0) {
 			/*
 			 * Received EOF or error.  They are treated


-d

-- 
| Damien Miller <djm at mindrot.org> \ ``E-mail attachments are the poor man's
| http://www.mindrot.org          /   distributed filesystem'' - Dan Geer




More information about the openssh-unix-dev mailing list