From c6f9f06c45bae0de6240f1555c6d771d9fbb9222 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 7 Apr 2017 08:38:56 -0600 Subject: [PATCH] Check return value of dispatch_pending_signals() in case we received SIGINT or SIGQUIT before executing the command. --- src/exec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/exec.c b/src/exec.c index 577a56ac5..e7dcf539a 100644 --- a/src/exec.c +++ b/src/exec.c @@ -205,7 +205,10 @@ sudo_execute(struct command_details *details, struct command_status *cstat) { debug_decl(sudo_execute, SUDO_DEBUG_EXEC) - dispatch_pending_signals(cstat); + if (dispatch_pending_signals(cstat) != 0) { + /* Killed by SIGINT or SIGQUIT */ + debug_return_int(0); + } /* If running in background mode, fork and exit. */ if (ISSET(details->flags, CD_BACKGROUND)) {