From 930d04412b320c3c7e196d6ce1ad7f2b5a9a2bec Mon Sep 17 00:00:00 2001 From: dtucker Date: Sun, 11 Jul 2004 06:54:08 +0000 Subject: [PATCH] - (dtucker) [auth-pam.c] Check for zero from waitpid() too, which allows the monitor to properly clean up the PAM thread (Debian bug #252676). --- ChangeLog | 4 ++++ auth-pam.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86146b4c..22264583 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +20040711 + - (dtucker) [auth-pam.c] Check for zero from waitpid() too, which allows + the monitor to properly clean up the PAM thread (Debian bug #252676). + 20040709 - (tim) [contrib/cygwin/README] add minires-devel requirement. Patch from vinschen AT redhat.com diff --git a/auth-pam.c b/auth-pam.c index 76a43a35..59d20555 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -113,11 +113,11 @@ sshpam_sigchld_handler(int sig) if (cleanup_ctxt == NULL) return; /* handler called after PAM cleanup, shouldn't happen */ if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG) - == -1) { + <= 0) { /* PAM thread has not exitted, privsep slave must have */ kill(cleanup_ctxt->pam_thread, SIGTERM); if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) - == -1) + <= 0) return; /* could not wait */ } if (WIFSIGNALED(sshpam_thread_status) && -- 2.45.1