mirror of
git://anongit.mindrot.org/openssh.git
synced 2024-11-27 14:44:21 +08:00
- 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
This commit is contained in:
parent
be6a5a6dfe
commit
b3144e58e7
@ -30,6 +30,9 @@
|
||||
- stevesk@cvs.openbsd.org 2001/03/05 17:58:22
|
||||
[dh.c]
|
||||
spelling
|
||||
- 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
|
||||
|
||||
20010305
|
||||
- (bal) CVS ID touch up on sshpty.[ch] and sshlogin.[ch]
|
||||
@ -4401,4 +4404,4 @@
|
||||
- Wrote replacements for strlcpy and mkdtemp
|
||||
- Released 1.0pre1
|
||||
|
||||
$Id: ChangeLog,v 1.915 2001/03/06 01:13:06 mouring Exp $
|
||||
$Id: ChangeLog,v 1.916 2001/03/06 03:31:34 mouring Exp $
|
||||
|
6
authfd.c
6
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 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
|
||||
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 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
|
||||
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;
|
||||
|
10
cli.c
10
cli.c
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $ */
|
||||
/* $OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2000 Markus Friedl. All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $");
|
||||
RCSID("$OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $");
|
||||
|
||||
#include "xmalloc.h"
|
||||
#include "log.h"
|
||||
@ -134,12 +134,16 @@ cli_read(char* buf, int size, int echo)
|
||||
{
|
||||
char ch = 0;
|
||||
int i = 0;
|
||||
int n;
|
||||
|
||||
if (!echo)
|
||||
cli_echo_disable();
|
||||
|
||||
while (ch != '\n') {
|
||||
if (read(cli_input, &ch, 1) != 1)
|
||||
n = read(cli_input, &ch, 1);
|
||||
if (n == -1 && (errno == EAGAIN || errno == EINTR))
|
||||
continue;
|
||||
if (n != 1)
|
||||
break;
|
||||
if (ch == '\n' || intr != 0)
|
||||
break;
|
||||
|
24
ssh-agent.c
24
ssh-agent.c
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $ */
|
||||
/* $OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $ */
|
||||
|
||||
/*
|
||||
* Author: Tatu Ylonen <ylo@cs.hut.fi>
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include "includes.h"
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $");
|
||||
RCSID("$OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $");
|
||||
|
||||
#include <openssl/evp.h>
|
||||
#include <openssl/md5.h>
|
||||
@ -635,9 +635,15 @@ after_select(fd_set *readset, fd_set *writeset)
|
||||
case AUTH_CONNECTION:
|
||||
if (buffer_len(&sockets[i].output) > 0 &&
|
||||
FD_ISSET(sockets[i].fd, writeset)) {
|
||||
len = write(sockets[i].fd,
|
||||
buffer_ptr(&sockets[i].output),
|
||||
buffer_len(&sockets[i].output));
|
||||
do {
|
||||
len = write(sockets[i].fd,
|
||||
buffer_ptr(&sockets[i].output),
|
||||
buffer_len(&sockets[i].output));
|
||||
if (len == -1 && (errno == EAGAIN ||
|
||||
errno == EINTR))
|
||||
continue;
|
||||
break;
|
||||
} while (1);
|
||||
if (len <= 0) {
|
||||
shutdown(sockets[i].fd, SHUT_RDWR);
|
||||
close(sockets[i].fd);
|
||||
@ -649,7 +655,13 @@ after_select(fd_set *readset, fd_set *writeset)
|
||||
buffer_consume(&sockets[i].output, len);
|
||||
}
|
||||
if (FD_ISSET(sockets[i].fd, readset)) {
|
||||
len = read(sockets[i].fd, buf, sizeof(buf));
|
||||
do {
|
||||
len = read(sockets[i].fd, buf, sizeof(buf));
|
||||
if (len == -1 && (errno == EAGAIN ||
|
||||
errno == EINTR))
|
||||
continue;
|
||||
break;
|
||||
} while (1);
|
||||
if (len <= 0) {
|
||||
shutdown(sockets[i].fd, SHUT_RDWR);
|
||||
close(sockets[i].fd);
|
||||
|
Loading…
Reference in New Issue
Block a user