Skip to content

Commit 4795e4b

Browse files
committed
Always disable core dumps when sudo sends itself a fatal signal.
When a command exits due to a fatal signal, sudo will re-send that signal to itself so the shell does not ignore keyboard-generated signals. However, now that sudo disables core dumps by default for the command, we cannot rely on WCOREDUMP() telling us whether or not the signal will lead to a core dump. It is safest to always disable core dumps before sending the signal to ourself. --HG-- branch : 1.9
1 parent 79bf096 commit 4795e4b

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/sudo.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,10 @@ main(int argc, char *argv[], char *envp[])
315315
if (WIFSIGNALED(status)) {
316316
struct sigaction sa;
317317

318-
if (WCOREDUMP(status))
319-
disable_coredump();
318+
/* Make sure sudo doesn't dump core itself. */
319+
disable_coredump();
320320

321+
/* Re-send the signal to the main sudo process. */
321322
memset(&sa, 0, sizeof(sa));
322323
sigemptyset(&sa.sa_mask);
323324
sa.sa_handler = SIG_DFL;

0 commit comments

Comments
 (0)