From: Todd C. Miller Date: Tue, 1 Jun 2010 14:58:11 +0000 (-0400) Subject: Fix a bug where we could treat EAGAIN as a permanent error. X-Git-Tag: SUDO_1_8_0~550 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1eafb30a4485eab827e13954909ec89f54461936;p=sudo Fix a bug where we could treat EAGAIN as a permanent error. Also set cstat if perform_io() returns an error. --- diff --git a/src/exec.c b/src/exec.c index ccea358fe..b234ef238 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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) {