summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2002-12-21 15:09:58 +0000
committerdes <des@FreeBSD.org>2002-12-21 15:09:58 +0000
commita9741e060abda4858c722294e0cf9857a5614cd9 (patch)
tree562a549428d2f1ee43c0af72a164feeec1b412bb /crypto
parentc877a609a92a1161f69d1d6a8a883e61600dcbb2 (diff)
downloadFreeBSD-src-a9741e060abda4858c722294e0cf9857a5614cd9.zip
FreeBSD-src-a9741e060abda4858c722294e0cf9857a5614cd9.tar.gz
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.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/openssh/auth2-pam-freebsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/openssh/auth2-pam-freebsd.c b/crypto/openssh/auth2-pam-freebsd.c
index 895ce5a..4094965 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);
}
OpenPOWER on IntegriCloud