From d1f1065f1ab08a3a1d0e9ef4b76a7b58fd613db2 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 6 Feb 2011 17:27:58 -0500 Subject: [PATCH] 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 --- exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 */ } -- 2.40.0