From a11e4c8d72a79c9bdfc4293d29ca9bf4d41c2223 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 15 Oct 2010 16:24:42 -0400 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. --- src/exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/exec.c b/src/exec.c index 09e58dc42..ced5e09ef 100644 --- a/src/exec.c +++ b/src/exec.c @@ -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) { -- 2.40.0