]> granicus.if.org Git - sudo/commitdiff
If perform_io() fails, kill the child before exiting so it doesn't
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Oct 2010 20:24:42 +0000 (16:24 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 15 Oct 2010 20:24:42 +0000 (16:24 -0400)
complain about connection reset.  We can get an I/O error if, for
example, and we get EIO reading from stdin.

src/exec.c

index 09e58dc42ba504fcbf7e946535ac48956e09efa2..ced5e09ef943a30f2ea4aee636c5bab42995e68c 100644 (file)
@@ -310,8 +310,12 @@ sudo_execve(struct command_details *details, char *argv[], char *envp[],
            }
        }
 
-       if (perform_io(fdsr, fdsw, cstat) != 0)
+       if (perform_io(fdsr, fdsw, cstat) != 0) {
+           /* I/O error, kill child if still alive and finish. */
+           schedule_signal(SIGKILL);
+           forward_signals(sv[0]);
            break;
+       }
     }
 
     if (log_io) {