From: Todd C. Miller Date: Sun, 6 Feb 2011 22:27:58 +0000 (-0500) Subject: If perform_io() fails, kill the child before exiting so it doesn't X-Git-Tag: SUDO_1_7_5~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d1f1065f1ab08a3a1d0e9ef4b76a7b58fd613db2;p=sudo If perform_io() fails, kill the child before exiting so it doesn't 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 --- diff --git a/exec.c b/exec.c index 0c340f93c..91a4d1e90 100644 --- 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 */ }