Add missing initialization of a sigaction structure when I/O logging.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 23 Apr 2012 18:56:31 +0000 (14:56 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 23 Apr 2012 18:56:31 +0000 (14:56 -0400)
Fixes a potential problem when suspending the command.

src/exec_pty.c

index ba77b014c4f4f3fe247798b442057b76668d2d5f..0011847909551709923d558200f04a617f4cfec7 100644 (file)
@@ -334,6 +334,9 @@ suspend_parent(int signo)
        }
 
        /* Suspend self and continue child when we resume. */
+       zero_bytes(&sa, sizeof(sa));
+       sigemptyset(&sa.sa_mask);
+       sa.sa_flags = SA_INTERRUPT; /* do not restart syscalls */
        sa.sa_handler = SIG_DFL;
        sigaction(signo, &sa, &osa);
        sudo_debug_printf(SUDO_DEBUG_INFO, "kill parent %d", signo);