summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--clientloop.c11
-rw-r--r--packet.c11
-rw-r--r--ssh-keyscan.c7
4 files changed, 27 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 14424b682..6ffe51708 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,9 @@
20 ssh-keygen.c sshd.8] 20 ssh-keygen.c sshd.8]
21 PermitRootLogin={yes,without-password,forced-commands-only,no} 21 PermitRootLogin={yes,without-password,forced-commands-only,no}
22 (before this change, root could login even if PermitRootLogin==no) 22 (before this change, root could login even if PermitRootLogin==no)
23 - deraadt@cvs.openbsd.org 2001/02/12 22:56:09
24 [clientloop.c packet.c ssh-keyscan.c]
25 deal with EAGAIN/EINTR selects which were skipped
23 26
2420010214 2720010214
25 - (djm) Don't try to close PAM session or delete credentials if the 28 - (djm) Don't try to close PAM session or delete credentials if the
@@ -3948,4 +3951,4 @@
3948 - Wrote replacements for strlcpy and mkdtemp 3951 - Wrote replacements for strlcpy and mkdtemp
3949 - Released 1.0pre1 3952 - Released 1.0pre1
3950 3953
3951$Id: ChangeLog,v 1.764 2001/02/15 03:08:27 mouring Exp $ 3954$Id: ChangeLog,v 1.765 2001/02/15 03:12:08 mouring Exp $
diff --git a/clientloop.c b/clientloop.c
index e892c1abd..547ccabfe 100644
--- a/clientloop.c
+++ b/clientloop.c
@@ -59,7 +59,7 @@
59 */ 59 */
60 60
61#include "includes.h" 61#include "includes.h"
62RCSID("$OpenBSD: clientloop.c,v 1.49 2001/02/08 19:30:51 itojun Exp $"); 62RCSID("$OpenBSD: clientloop.c,v 1.51 2001/02/13 21:51:09 markus Exp $");
63 63
64#include "ssh.h" 64#include "ssh.h"
65#include "ssh1.h" 65#include "ssh1.h"
@@ -406,6 +406,15 @@ client_wait_until_can_do_something(fd_set **readsetp, fd_set **writesetp,
406 406
407 if (select((*maxfdp)+1, *readsetp, *writesetp, NULL, NULL) < 0) { 407 if (select((*maxfdp)+1, *readsetp, *writesetp, NULL, NULL) < 0) {
408 char buf[100]; 408 char buf[100];
409
410 /*
411 * We have to clear the select masks, because we return.
412 * We have to return, because the mainloop checks for the flags
413 * set by the signal handlers.
414 */
415 memset(*readsetp, 0, *maxfdp);
416 memset(*writesetp, 0, *maxfdp);
417
409 if (errno == EINTR) 418 if (errno == EINTR)
410 return; 419 return;
411 /* Note: we might still have data in the buffers. */ 420 /* Note: we might still have data in the buffers. */
diff --git a/packet.c b/packet.c
index 46e89bc0c..fb4314553 100644
--- a/packet.c
+++ b/packet.c
@@ -37,7 +37,7 @@
37 */ 37 */
38 38
39#include "includes.h" 39#include "includes.h"
40RCSID("$OpenBSD: packet.c,v 1.50 2001/02/11 12:59:25 markus Exp $"); 40RCSID("$OpenBSD: packet.c,v 1.51 2001/02/12 22:56:09 deraadt Exp $");
41 41
42#include "xmalloc.h" 42#include "xmalloc.h"
43#include "buffer.h" 43#include "buffer.h"
@@ -688,7 +688,9 @@ packet_read(int *payload_len_ptr)
688 FD_SET(connection_in, &set); 688 FD_SET(connection_in, &set);
689 689
690 /* Wait for some data to arrive. */ 690 /* Wait for some data to arrive. */
691 select(connection_in + 1, &set, NULL, NULL, NULL); 691 while (select(connection_in + 1, &set, NULL, NULL, NULL) == -1 &&
692 (errno == EAGAIN || errno == EINTR))
693 ;
692 694
693 /* Read data from the socket. */ 695 /* Read data from the socket. */
694 len = read(connection_in, buf, sizeof(buf)); 696 len = read(connection_in, buf, sizeof(buf));
@@ -1195,9 +1197,12 @@ packet_write_wait()
1195 packet_write_poll(); 1197 packet_write_poll();
1196 while (packet_have_data_to_write()) { 1198 while (packet_have_data_to_write()) {
1197 fd_set set; 1199 fd_set set;
1200
1198 FD_ZERO(&set); 1201 FD_ZERO(&set);
1199 FD_SET(connection_out, &set); 1202 FD_SET(connection_out, &set);
1200 select(connection_out + 1, NULL, &set, NULL, NULL); 1203 while (select(connection_out + 1, NULL, &set, NULL, NULL) == -1 &&
1204 (errno == EAGAIN || errno == EINTR))
1205 ;
1201 packet_write_poll(); 1206 packet_write_poll();
1202 } 1207 }
1203} 1208}
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 834649fef..5cd368e93 100644
--- a/ssh-keyscan.c
+++ b/ssh-keyscan.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#include "includes.h" 10#include "includes.h"
11RCSID("$OpenBSD: ssh-keyscan.c,v 1.15 2001/02/09 09:04:59 itojun Exp $"); 11RCSID("$OpenBSD: ssh-keyscan.c,v 1.16 2001/02/12 22:56:10 deraadt Exp $");
12 12
13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) 13#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
14#include <sys/queue.h> 14#include <sys/queue.h>
@@ -498,7 +498,10 @@ conloop(void)
498 seltime.tv_sec = seltime.tv_usec = 0; 498 seltime.tv_sec = seltime.tv_usec = 0;
499 499
500 r = e = read_wait; 500 r = e = read_wait;
501 select(maxfd, &r, NULL, &e, &seltime); 501 while (select(maxfd, &r, NULL, &e, &seltime) == -1 &&
502 (errno == EAGAIN || errno == EINTR))
503 ;
504
502 for (i = 0; i < maxfd; i++) 505 for (i = 0; i < maxfd; i++)
503 if (FD_ISSET(i, &e)) { 506 if (FD_ISSET(i, &e)) {
504 error("%s: exception!", fdcon[i].c_name); 507 error("%s: exception!", fdcon[i].c_name);