2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

If the event loop exits due to an error and we are not logging I/O,

kill the command if still running.  Fixes a bug where sudo could
exit while the command was still running.
This commit is contained in:
Todd C. Miller
2014-01-14 20:34:20 -07:00
parent 77b126acc4
commit 640a5ddb48

View File

@@ -483,6 +483,9 @@ sudo_execute(struct command_details *details, struct command_status *cstat)
if (sudo_ev_got_break(evbase)) {
/* error from callback */
sudo_debug_printf(SUDO_DEBUG_ERROR, "event loop exited prematurely");
/* kill command if still running and not I/O logging */
if (!log_io && kill(child, 0) == 0)
terminate_command(child, true);
}
if (log_io) {