summaryrefslogtreecommitdiff
path: root/ssh-agent.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-06 03:31:34 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-06 03:31:34 +0000
commitb3144e58e74ad9cc3c07da94264c3ccbfccb5cf7 (patch)
tree9ad479c3eef78443192fc92f20a281ac45cca8ed /ssh-agent.c
parentbe6a5a6dfe14c516b0982e57bb95f022bf19cf46 (diff)
- 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
Diffstat (limited to 'ssh-agent.c')
-rw-r--r--ssh-agent.c24
1 files changed, 18 insertions, 6 deletions
diff --git a/ssh-agent.c b/ssh-agent.c
index a558ecef7..5a774d570 100644
--- a/ssh-agent.c
+++ b/ssh-agent.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $ */ 1/* $OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $ */
2 2
3/* 3/*
4 * Author: Tatu Ylonen <ylo@cs.hut.fi> 4 * Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $"); 40RCSID("$OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $");
41 41
42#include <openssl/evp.h> 42#include <openssl/evp.h>
43#include <openssl/md5.h> 43#include <openssl/md5.h>
@@ -635,9 +635,15 @@ after_select(fd_set *readset, fd_set *writeset)
635 case AUTH_CONNECTION: 635 case AUTH_CONNECTION:
636 if (buffer_len(&sockets[i].output) > 0 && 636 if (buffer_len(&sockets[i].output) > 0 &&
637 FD_ISSET(sockets[i].fd, writeset)) { 637 FD_ISSET(sockets[i].fd, writeset)) {
638 len = write(sockets[i].fd, 638 do {
639 buffer_ptr(&sockets[i].output), 639 len = write(sockets[i].fd,
640 buffer_len(&sockets[i].output)); 640 buffer_ptr(&sockets[i].output),
641 buffer_len(&sockets[i].output));
642 if (len == -1 && (errno == EAGAIN ||
643 errno == EINTR))
644 continue;
645 break;
646 } while (1);
641 if (len <= 0) { 647 if (len <= 0) {
642 shutdown(sockets[i].fd, SHUT_RDWR); 648 shutdown(sockets[i].fd, SHUT_RDWR);
643 close(sockets[i].fd); 649 close(sockets[i].fd);
@@ -649,7 +655,13 @@ after_select(fd_set *readset, fd_set *writeset)
649 buffer_consume(&sockets[i].output, len); 655 buffer_consume(&sockets[i].output, len);
650 } 656 }
651 if (FD_ISSET(sockets[i].fd, readset)) { 657 if (FD_ISSET(sockets[i].fd, readset)) {
652 len = read(sockets[i].fd, buf, sizeof(buf)); 658 do {
659 len = read(sockets[i].fd, buf, sizeof(buf));
660 if (len == -1 && (errno == EAGAIN ||
661 errno == EINTR))
662 continue;
663 break;
664 } while (1);
653 if (len <= 0) { 665 if (len <= 0) {
654 shutdown(sockets[i].fd, SHUT_RDWR); 666 shutdown(sockets[i].fd, SHUT_RDWR);
655 close(sockets[i].fd); 667 close(sockets[i].fd);