]> 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:59 +0000 (13:36 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 31 Jul 2012 17:36:59 +0000 (13:36 -0400)
against SI_USER instead of <= 0 since on HP-UX, terminal-related
signals get a code of 0.

--HG--
branch : 1.7

exec.c

diff --git a/exec.c b/exec.c
index fa0fd5186952e5a96ebe7cb3308f09c571abaeaa..8bc1b4238e81e3aa7cc88858156ef726fe53d712 100644 (file)
--- a/exec.c
+++ b/exec.c
@@ -672,7 +672,7 @@ handler_nofwd(s, info, 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.