~ubuntu-branches/ubuntu/dapper/openssh/dapper

« back to all changes in this revision

Viewing changes to auth-pam.c

  • Committer: Bazaar Package Importer
  • Author(s): Colin Watson
  • Date: 2004-10-07 18:03:06 UTC
  • Revision ID: james.westby@ubuntu.com-20041007180306-0l8ii961txetbucx
Tags: 1:3.8.1p1-11ubuntu3
* Nathaniel McCallum:
  - debian/openssh-server.init: pretty initscript
  - debian/control: versioned depend on lsb-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
static void 
94
94
sshpam_sigchld_handler(int sig)
95
95
{
 
96
        signal(SIGCHLD, SIG_DFL);
96
97
        if (cleanup_ctxt == NULL)
97
98
                return; /* handler called after PAM cleanup, shouldn't happen */
98
 
        if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0) == -1)
99
 
                return; /* couldn't wait for process */
 
99
        if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, WNOHANG)
 
100
             <= 0) {
 
101
                /* PAM thread has not exitted, privsep slave must have */
 
102
                kill(cleanup_ctxt->pam_thread, SIGTERM);
 
103
                if (waitpid(cleanup_ctxt->pam_thread, &sshpam_thread_status, 0)
 
104
                    <= 0)
 
105
                        return; /* could not wait */
 
106
        }
100
107
        if (WIFSIGNALED(sshpam_thread_status) &&
101
108
            WTERMSIG(sshpam_thread_status) == SIGTERM)
102
109
                return; /* terminated by pthread_cancel */