diff options
author | Darren Tucker <dtucker@zip.com.au> | 2004-01-14 23:07:56 +1100 |
---|---|---|
committer | Darren Tucker <dtucker@zip.com.au> | 2004-01-14 23:07:56 +1100 |
commit | 7ae09627982e4a7cdf072f8900b212c9b590c23c (patch) | |
tree | 5faa750c41bbfa1aed9759ff049b04c4553207e9 | |
parent | 749bc95bd81aca8c69829551f9f1ae8c7d0bdefa (diff) |
- (dtucker) [auth-pam.c] Reset signal handler in pthread_cancel too, add
test for case where cleanup has already run.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | auth-pam.c | 5 |
2 files changed, 7 insertions, 2 deletions
@@ -1,6 +1,8 @@ | |||
1 | 20040114 | 1 | 20040114 |
2 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits | 2 | - (dtucker) [auth-pam.c] Have monitor die if PAM authentication thread exits |
3 | unexpectedly. with & ok djm@ | 3 | unexpectedly. with & ok djm@ |
4 | - (dtucker) [auth-pam.c] Reset signal handler in pthread_cancel too, add | ||
5 | test for case where cleanup has already run. | ||
4 | 6 | ||
5 | 20040113 | 7 | 20040113 |
6 | - (dtucker) [auth-pam.c] Relocate struct pam_ctxt and prototypes. No | 8 | - (dtucker) [auth-pam.c] Relocate struct pam_ctxt and prototypes. No |
@@ -1663,4 +1665,4 @@ | |||
1663 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 1665 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
1664 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 1666 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
1665 | 1667 | ||
1666 | $Id: ChangeLog,v 1.3167 2004/01/14 11:14:04 dtucker Exp $ | 1668 | $Id: ChangeLog,v 1.3168 2004/01/14 12:07:56 dtucker Exp $ |
diff --git a/auth-pam.c b/auth-pam.c index 14d0c7b7f..45c5e0a0a 100644 --- a/auth-pam.c +++ b/auth-pam.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ | 32 | /* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */ |
33 | #include "includes.h" | 33 | #include "includes.h" |
34 | RCSID("$Id: auth-pam.c,v 1.90 2004/01/14 11:14:05 dtucker Exp $"); | 34 | RCSID("$Id: auth-pam.c,v 1.91 2004/01/14 12:07:56 dtucker Exp $"); |
35 | 35 | ||
36 | #ifdef USE_PAM | 36 | #ifdef USE_PAM |
37 | #if defined(HAVE_SECURITY_PAM_APPL_H) | 37 | #if defined(HAVE_SECURITY_PAM_APPL_H) |
@@ -92,6 +92,8 @@ static mysig_t sshpam_oldsig; | |||
92 | static void | 92 | static void |
93 | sshpam_sigchld_handler(int sig) | 93 | sshpam_sigchld_handler(int sig) |
94 | { | 94 | { |
95 | if (cleanup_ctxt == NULL) | ||
96 | return; /* handler called after PAM cleanup, shouldn't happen */ | ||
95 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) == -1) | 97 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) == -1) |
96 | return; /* couldn't wait for process */ | 98 | return; /* couldn't wait for process */ |
97 | if (WIFSIGNALED(sshpam_thread_status) && | 99 | if (WIFSIGNALED(sshpam_thread_status) && |
@@ -132,6 +134,7 @@ pthread_create(sp_pthread_t *thread, const void *attr __unused, | |||
132 | static int | 134 | static int |
133 | pthread_cancel(sp_pthread_t thread) | 135 | pthread_cancel(sp_pthread_t thread) |
134 | { | 136 | { |
137 | signal(SIGCHLD, sshpam_oldsig); | ||
135 | return (kill(thread, SIGTERM)); | 138 | return (kill(thread, SIGTERM)); |
136 | } | 139 | } |
137 | 140 | ||