]> granicus.if.org Git - sudo/commitdiff
Fix a bug where we could treat EAGAIN as a permanent error.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 1 Jun 2010 14:58:11 +0000 (10:58 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 1 Jun 2010 14:58:11 +0000 (10:58 -0400)
Also set cstat if perform_io() returns an error.

src/exec.c

index ccea358fec5bc3e14426e571f4275cbdf0d81ed6..b234ef238b4f2db1951f4e80d7d4bd12209088ac 100644 (file)
@@ -799,12 +799,11 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[],
            if (n == -1) {
                if (errno == EINTR)
                    continue;
-               if (log_io && errno != EAGAIN) {
-                   /* Did the other end of the pipe go away? */
+               if (errno != EAGAIN) {
                    cstat->type = CMD_ERRNO;
                    cstat->val = errno;
+                   break;
                }
-               break;
            }
            if (cstat->type == CMD_WSTATUS) {
                if (WIFSTOPPED(cstat->val)) {
@@ -840,8 +839,11 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[],
                }
            }
        }
-       if (perform_io(iobufs, fdsr, fdsw) != 0)
+       if (perform_io(iobufs, fdsr, fdsw) != 0) {
+           cstat->type = CMD_ERRNO;
+           cstat->val = errno;
            break;
+       }
     }
 
     if (log_io) {