]> andersk Git - openssh.git/commitdiff
- (dtucker) [auth-pam.c] Bug #839: Ensure that pam authentication "thread"
authordtucker <dtucker>
Mon, 24 May 2004 01:53:42 +0000 (01:53 +0000)
committerdtucker <dtucker>
Mon, 24 May 2004 01:53:42 +0000 (01:53 +0000)
   is terminated if the privsep slave exits during keyboard-interactive
   authentication.  ok djm@

ChangeLog
auth-pam.c

index f6a1c87e1e0442b8da0f9fe227eec0fe7e5d4c1f..8e05dc6a31d1e73d020b7b8b3f7136cb39b94452 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+20040524
+ - (dtucker) [auth-pam.c] Bug #839: Ensure that pam authentication "thread"
+   is terminated if the privsep slave exits during keyboard-interactive
+   authentication.  ok djm@
+
 20040513
  - (dtucker) [configure.ac] Bug #867: Additional tests for res_query in
    libresolv, fixes problems detecting it on some platforms
index 9eb317487ef26c919da366687570d8fb0ff781f5..d8735edf36e6a06dc58259ccd22b6b76c2af8eea 100644 (file)
@@ -93,10 +93,17 @@ static mysig_t sshpam_oldsig;
 static void 
 sshpam_sigchld_handler(int sig)
 {
+       signal(SIGCHLD, SIG_DFL);
        if (cleanup_ctxt == NULL)
                return; /* handler called after PAM cleanup, shouldn't happen */
-       if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) == -1)
-               return; /* couldn't wait for process */
+       if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG)
+            == -1) {
+               /* 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)
+                       return; /* could not wait */
+       }
        if (WIFSIGNALED(sshpam_thread_status) &&
            WTERMSIG(sshpam_thread_status) == SIGTERM)
                return; /* terminated by pthread_cancel */
This page took 2.572592 seconds and 5 git commands to generate.