From owner-freebsd-current Sun Apr 21 11: 3: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id D3E2737B404; Sun, 21 Apr 2002 11:03:05 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 0D0815309; Sun, 21 Apr 2002 20:03:00 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: "Andrey A. Chernov" Cc: current@freebsd.org, green@freebsd.org Subject: Re: SSH: zombie appearse probably related to PAM References: <20020420101720.GA3526@nagual.pp.ru> <20020420160753.GB6816@nagual.pp.ru> <20020421141709.GA16522@nagual.pp.ru> From: Dag-Erling Smorgrav Date: 21 Apr 2002 20:02:59 +0200 In-Reply-To: Message-ID: Lines: 14 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= Dag-Erling Smorgrav 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 #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