]> granicus.if.org Git - sudo/commitdiff
When not logging I/O install a handler for SIGCONT and deliver it
authormillert@rh4-x86.home.courtesan.com <millert@rh4-x86.home.courtesan.com>
Tue, 24 Aug 2010 01:01:00 +0000 (21:01 -0400)
committermillert@rh4-x86.home.courtesan.com <millert@rh4-x86.home.courtesan.com>
Tue, 24 Aug 2010 01:01:00 +0000 (21:01 -0400)
to the command upon resume.  Fixes bugzilla #431

--HG--
branch : 1.7

exec.c

diff --git a/exec.c b/exec.c
index a15403cc20a957a8b3265e53bdbe3d22f2812547..784f90ab40ff80020dc18f2ea12105076042b5c9 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -101,8 +101,15 @@ static int fork_cmnd(path, argv, envp, sv, rbac_enabled)
     int rbac_enabled;
 {
     struct command_status cstat;
+    sigaction_t sa;
     int pid;
 
+    zero_bytes(&sa, sizeof(sa));
+    sigemptyset(&sa.sa_mask);
+    sa.sa_flags = SA_INTERRUPT; /* do not restart syscalls */
+    sa.sa_handler = handler;
+    sigaction(SIGCONT, &sa, NULL);
+
     pid = fork();
     switch (pid) {
     case -1: