]> granicus.if.org Git - sudo/commitdiff
Check return value of dispatch_pending_signals() in case we received
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 7 Apr 2017 14:38:56 +0000 (08:38 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 7 Apr 2017 14:38:56 +0000 (08:38 -0600)
SIGINT or SIGQUIT before executing the command.

src/exec.c

index 577a56ac5e08c86b6f16fd629cb8603c52f34c8b..e7dcf539a11119679fce23f8c7e435fc0c588224 100644 (file)
@@ -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)) {