]> 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>
Sun, 6 Feb 2011 22:27:58 +0000 (17:27 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sun, 6 Feb 2011 22:27:58 +0000 (17:27 -0500)
complain about connection reset.  We can get an I/O error if, for
example, and we get EIO reading from stdin.

--HG--
branch : 1.7

exec.c

diff --git a/exec.c b/exec.c
index 0c340f93cc0aaffb01550802b04e18fb66802605..91a4d1e90498d3033ffeaeb0d711793f2f3eed24 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -402,8 +402,12 @@ sudo_execve(path, argv, envp, uid, cstat, dowait, bgmode)
        }
 
 #ifdef _PATH_SUDO_IO_LOGDIR
-       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;
+       }
 #endif /* _PATH_SUDO_IO_LOGDIR */
     }