From d85a11e29f3dc55b159e0b3413c1309bf9c5095f Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 10 Jul 2004 12:36:49 +0000 Subject: Apply patch from Darren Tucker to make the PAM authentication SIGCHLD handler kill the PAM thread if its waitpid() call returns 0, as well as the previous check for -1 (closes: #252676). --- auth-pam.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'auth-pam.c') diff --git a/auth-pam.c b/auth-pam.c index 361573807..701d85b64 100644 --- a/auth-pam.c +++ b/auth-pam.c @@ -97,11 +97,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) && -- cgit v1.2.3