]> andersk Git - openssh.git/blobdiff - authfd.c
- (dtucker) [Makefile.in] Add a install-nosysconf target for installing the
[openssh.git] / authfd.c
index 5fdf1ca3da97c5227ace1377520d2d47cf891ad8..662350cef7ec4ea30655b6f621be6e7ac8f8463a 100644 (file)
--- a/authfd.c
+++ b/authfd.c
@@ -35,7 +35,7 @@
  */
 
 #include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.62 2003/09/18 13:02:21 miod Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $");
 
 #include <openssl/evp.h>
 
@@ -133,16 +133,9 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
         * Wait for response from the agent.  First read the length of the
         * response packet.
         */
-       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;
-               }
-               len -= l;
+       if (atomicio(read, auth->fd, buf, 4) != 4) {
+           error("Error reading response length from authentication socket.");
+           return 0;
        }
 
        /* Extract the length, and check it for sanity. */
@@ -156,9 +149,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
                l = len;
                if (l > sizeof(buf))
                        l = sizeof(buf);
-               l = read(auth->fd, buf, l);
-               if (l == -1 && (errno == EAGAIN || errno == EINTR))
-                       continue;
+               l = atomicio(read, auth->fd, buf, l);
                if (l <= 0) {
                        error("Error reading response from authentication socket.");
                        return 0;
@@ -590,7 +581,7 @@ ssh_remove_identity(AuthenticationConnection *auth, Key *key)
 }
 
 int
-ssh_update_card(AuthenticationConnection *auth, int add, 
+ssh_update_card(AuthenticationConnection *auth, int add,
     const char *reader_id, const char *pin, u_int life, u_int confirm)
 {
        Buffer msg;
@@ -607,7 +598,7 @@ ssh_update_card(AuthenticationConnection *auth, int add,
        buffer_put_char(&msg, type);
        buffer_put_cstring(&msg, reader_id);
        buffer_put_cstring(&msg, pin);
-       
+
        if (constrained) {
                if (life != 0) {
                        buffer_put_char(&msg, SSH_AGENT_CONSTRAIN_LIFETIME);
This page took 0.054375 seconds and 4 git commands to generate.