Skip site navigation (1)Skip section navigation (2)
Date:      21 Apr 2002 20:02:59 +0200
From:      Dag-Erling Smorgrav <des@ofug.org>
To:        "Andrey A. Chernov" <ache@nagual.pp.ru>
Cc:        current@freebsd.org, green@freebsd.org
Subject:   Re: SSH: zombie appearse probably related to PAM
Message-ID:  <xzpy9fh3p64.fsf@flood.ping.uio.no>
In-Reply-To: <xzp7kn153ym.fsf@flood.ping.uio.no>
References:  <20020420101720.GA3526@nagual.pp.ru> <xzpd6wuqrwk.fsf@flood.ping.uio.no> <20020420160753.GB6816@nagual.pp.ru> <20020421141709.GA16522@nagual.pp.ru> <xzp7kn153ym.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
--=-=-=

Dag-Erling Smorgrav <des@ofug.org> 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 - des@ofug.org


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment; filename=openssh.diff

==== //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);
 }

--=-=-=--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?xzpy9fh3p64.fsf>