diff options
author | Colin Watson <cjwatson@debian.org> | 2004-07-10 12:36:49 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2004-07-10 12:36:49 +0000 |
commit | d85a11e29f3dc55b159e0b3413c1309bf9c5095f (patch) | |
tree | e7aa997673b574d5535bb5d7da4b0c76f961dc1a /auth-pam.c | |
parent | 9d35f041a8b51e6fed3cd4207efba83d3cb61fd8 (diff) |
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).
Diffstat (limited to 'auth-pam.c')
-rw-r--r-- | auth-pam.c | 4 |
1 files changed, 2 insertions, 2 deletions
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) | |||
97 | if (cleanup_ctxt == NULL) | 97 | if (cleanup_ctxt == NULL) |
98 | return; /* handler called after PAM cleanup, shouldn't happen */ | 98 | return; /* handler called after PAM cleanup, shouldn't happen */ |
99 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG) | 99 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG) |
100 | == -1) { | 100 | <= 0) { |
101 | /* PAM thread has not exitted, privsep slave must have */ | 101 | /* PAM thread has not exitted, privsep slave must have */ |
102 | kill(cleanup_ctxt->pam_thread, SIGTERM); | 102 | kill(cleanup_ctxt->pam_thread, SIGTERM); |
103 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) | 103 | if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) |
104 | == -1) | 104 | <= 0) |
105 | return; /* could not wait */ | 105 | return; /* could not wait */ |
106 | } | 106 | } |
107 | if (WIFSIGNALED(sshpam_thread_status) && | 107 | if (WIFSIGNALED(sshpam_thread_status) && |