- deraadt@cvs.openbsd.org 2001/03/06 00:33:04
[authfd.c cli.c ssh-agent.c]
EINTR/EAGAIN handling is required in more cases
diff --git a/authfd.c b/authfd.c
index 76e9177..8613b9a 100644
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.37 2001/03/04 17:42:27 millert Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.38 2001/03/06 00:33:03 deraadt Exp $");
#include <openssl/evp.h>
@@ -120,6 +120,8 @@
len = 4;
while (len > 0) {
l = read(auth->fd, buf + 4 - len, len);
+ if (l == -1 && (errno == EAGAIN || errno == EINTR))
+ continue;
if (l <= 0) {
error("Error reading response length from authentication socket.");
return 0;
@@ -139,6 +141,8 @@
if (l > sizeof(buf))
l = sizeof(buf);
l = read(auth->fd, buf, l);
+ if (l == -1 && (errno == EAGAIN || errno == EINTR))
+ continue;
if (l <= 0) {
error("Error reading response from authentication socket.");
return 0;