Dag-Erling Smorgrav <[EMAIL PROTECTED]> writes:
> Actually, it means *sshd* omits waiting for its own child - PAM does
> not fork - and it still does not explain why I can't reproduce the
> problem.  In any case, please try the attached patch.

Umm, my brain was off when I wrote that.  Here's a working patch (that
also fixes some warnings)

DES
-- 
Dag-Erling Smorgrav - [EMAIL PROTECTED]

==== //depot/user/des/pam/crypto/openssh/auth2-pam.c#1 - /usr/src/crypto/openssh/auth2-pam.c ====
--- /tmp/tmp.36998.0	Sun Apr 21 20:00:05 2002
+++ /usr/src/crypto/openssh/auth2-pam.c	Sun Apr 21 19:58:57 2002
@@ -41,6 +41,7 @@
 #include <security/pam_appl.h>
 
 #include "auth.h"
+#include "log.h"
 #include "xmalloc.h"
 
 struct pam_ctxt {
@@ -128,8 +129,6 @@
 	 void *data)
 {
 	struct pam_ctxt *ctxt;
-	char *line;
-	size_t len;
 	int i;
 
 	ctxt = data;
@@ -176,7 +175,6 @@
 {
 	struct pam_conv pam_conv = { pam_child_conv, ctxt };
 	pam_handle_t *pamh;
-	char *msg;
 	int pam_err;
 
 	pam_err = pam_start("sshd", ctxt->pam_user, &pam_conv, &pamh);
@@ -315,10 +313,11 @@
 pam_free_ctx(void *ctxtp)
 {
 	struct pam_ctxt *ctxt = ctxtp;
-	int i;
+	int status;
 
 	close(ctxt->pam_sock);
 	kill(ctxt->pam_pid, SIGHUP);
+	waitpid(ctxt->pam_pid, &status, 0);
 	xfree(ctxt->pam_user);
 	xfree(ctxt);
 }

Reply via email to