]> granicus.if.org Git - sudo/commitdiff
When checking whether a signal is user-generated, compare si_code
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 31 Jul 2012 17:36:48 +0000 (13:36 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 31 Jul 2012 17:36:48 +0000 (13:36 -0400)
against SI_USER instead of <= 0 since on HP-UX, terminal-related
signals get a code of 0.

src/exec.c

index fd5cb26ae738192503dad2c9d198273b2e5a835d..d93549813f03f1da859f0f3eb639b0baea8662db 100644 (file)
@@ -636,7 +636,7 @@ handler_nofwd(int s, siginfo_t *info, void *context)
     unsigned char signo = (unsigned char)s;
 
     /* Only forward user-generated signals. */
-    if (info == NULL || info->si_code <= 0) {
+    if (info != NULL && info->si_code == SI_USER) {
        /*
         * The pipe is non-blocking, if we overflow the kernel's pipe
         * buffer we drop the signal.  This is not a problem in practice.