From d46e273b14d0cf845aee42346ea2a68ad16be00f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Sat, 21 Dec 2002 15:09:58 +0000 Subject: [PATCH] The previous commit contained a stupid mistake: ctxt->pam_[cp]sock was initialized after the call to pthread_create() instead of before. It just happened to work with threads enabled because ctxt is shared, but of course it doesn't work when we use a child process instead of threads. --- crypto/openssh/auth2-pam-freebsd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/openssh/auth2-pam-freebsd.c b/crypto/openssh/auth2-pam-freebsd.c index 895ce5a518a..4094965b979 100644 --- a/crypto/openssh/auth2-pam-freebsd.c +++ b/crypto/openssh/auth2-pam-freebsd.c @@ -294,6 +294,8 @@ pam_init_ctx(Authctxt *authctxt) xfree(ctxt); return (NULL); } + ctxt->pam_psock = socks[0]; + ctxt->pam_csock = socks[1]; if (pthread_create(&ctxt->pam_thread, NULL, pam_thread, ctxt) == -1) { error("PAM: failed to start authentication thread: %s", strerror(errno)); @@ -302,8 +304,6 @@ pam_init_ctx(Authctxt *authctxt) xfree(ctxt); return (NULL); } - ctxt->pam_psock = socks[0]; - ctxt->pam_csock = socks[1]; fatal_add_cleanup(pam_thread_cleanup, ctxt); return (ctxt); }