- (dtucker) [auth-pam.c] Add minor debugging.
This commit is contained in:
parent
7ae0962798
commit
a8df9248ce
|
@ -3,6 +3,7 @@
|
||||||
unexpectedly. with & ok djm@
|
unexpectedly. with & ok djm@
|
||||||
- (dtucker) [auth-pam.c] Reset signal handler in pthread_cancel too, add
|
- (dtucker) [auth-pam.c] Reset signal handler in pthread_cancel too, add
|
||||||
test for case where cleanup has already run.
|
test for case where cleanup has already run.
|
||||||
|
- (dtucker) [auth-pam.c] Add minor debugging.
|
||||||
|
|
||||||
20040113
|
20040113
|
||||||
- (dtucker) [auth-pam.c] Relocate struct pam_ctxt and prototypes. No
|
- (dtucker) [auth-pam.c] Relocate struct pam_ctxt and prototypes. No
|
||||||
|
@ -1665,4 +1666,4 @@
|
||||||
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
||||||
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
|
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.3168 2004/01/14 12:07:56 dtucker Exp $
|
$Id: ChangeLog,v 1.3169 2004/01/14 13:15:07 dtucker Exp $
|
||||||
|
|
15
auth-pam.c
15
auth-pam.c
|
@ -31,7 +31,7 @@
|
||||||
|
|
||||||
/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
|
/* Based on $FreeBSD: src/crypto/openssh/auth2-pam-freebsd.c,v 1.11 2003/03/31 13:48:18 des Exp $ */
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$Id: auth-pam.c,v 1.91 2004/01/14 12:07:56 dtucker Exp $");
|
RCSID("$Id: auth-pam.c,v 1.92 2004/01/14 13:15:08 dtucker Exp $");
|
||||||
|
|
||||||
#ifdef USE_PAM
|
#ifdef USE_PAM
|
||||||
#if defined(HAVE_SECURITY_PAM_APPL_H)
|
#if defined(HAVE_SECURITY_PAM_APPL_H)
|
||||||
|
@ -178,6 +178,7 @@ pam_getenvlist(pam_handle_t *pamh)
|
||||||
void
|
void
|
||||||
pam_password_change_required(int reqd)
|
pam_password_change_required(int reqd)
|
||||||
{
|
{
|
||||||
|
debug3("%s %d", __func__, reqd);
|
||||||
sshpam_new_authtok_reqd = reqd;
|
sshpam_new_authtok_reqd = reqd;
|
||||||
if (reqd) {
|
if (reqd) {
|
||||||
no_port_forwarding_flag |= 2;
|
no_port_forwarding_flag |= 2;
|
||||||
|
@ -198,6 +199,8 @@ import_environments(Buffer *b)
|
||||||
u_int i, num_env;
|
u_int i, num_env;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
debug3("PAM: %s entering", __func__);
|
||||||
|
|
||||||
/* Import variables set by do_pam_account */
|
/* Import variables set by do_pam_account */
|
||||||
sshpam_account_status = buffer_get_int(b);
|
sshpam_account_status = buffer_get_int(b);
|
||||||
pam_password_change_required(buffer_get_int(b));
|
pam_password_change_required(buffer_get_int(b));
|
||||||
|
@ -239,6 +242,7 @@ sshpam_thread_conv(int n, const struct pam_message **msg,
|
||||||
struct pam_response *reply;
|
struct pam_response *reply;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
debug3("PAM: %s entering, %d responses", __func__, n);
|
||||||
*resp = NULL;
|
*resp = NULL;
|
||||||
|
|
||||||
ctxt = data;
|
ctxt = data;
|
||||||
|
@ -397,6 +401,7 @@ sshpam_thread_cleanup(void)
|
||||||
{
|
{
|
||||||
struct pam_ctxt *ctxt = cleanup_ctxt;
|
struct pam_ctxt *ctxt = cleanup_ctxt;
|
||||||
|
|
||||||
|
debug3("PAM: %s entering", __func__);
|
||||||
if (ctxt != NULL && ctxt->pam_thread != 0) {
|
if (ctxt != NULL && ctxt->pam_thread != 0) {
|
||||||
pthread_cancel(ctxt->pam_thread);
|
pthread_cancel(ctxt->pam_thread);
|
||||||
pthread_join(ctxt->pam_thread, NULL);
|
pthread_join(ctxt->pam_thread, NULL);
|
||||||
|
@ -411,6 +416,7 @@ static int
|
||||||
sshpam_null_conv(int n, const struct pam_message **msg,
|
sshpam_null_conv(int n, const struct pam_message **msg,
|
||||||
struct pam_response **resp, void *data)
|
struct pam_response **resp, void *data)
|
||||||
{
|
{
|
||||||
|
debug3("PAM: %s entering, %d responses", __func__, n);
|
||||||
return (PAM_CONV_ERR);
|
return (PAM_CONV_ERR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -491,6 +497,7 @@ sshpam_init_ctx(Authctxt *authctxt)
|
||||||
struct pam_ctxt *ctxt;
|
struct pam_ctxt *ctxt;
|
||||||
int socks[2];
|
int socks[2];
|
||||||
|
|
||||||
|
debug3("PAM: %s entering", __func__);
|
||||||
/* Refuse to start if we don't have PAM enabled */
|
/* Refuse to start if we don't have PAM enabled */
|
||||||
if (!options.use_pam)
|
if (!options.use_pam)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -535,6 +542,7 @@ sshpam_query(void *ctx, char **name, char **info,
|
||||||
char *msg;
|
char *msg;
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
|
debug3("PAM: %s entering", __func__);
|
||||||
buffer_init(&buffer);
|
buffer_init(&buffer);
|
||||||
*name = xstrdup("");
|
*name = xstrdup("");
|
||||||
*info = xstrdup("");
|
*info = xstrdup("");
|
||||||
|
@ -601,7 +609,7 @@ sshpam_respond(void *ctx, u_int num, char **resp)
|
||||||
Buffer buffer;
|
Buffer buffer;
|
||||||
struct pam_ctxt *ctxt = ctx;
|
struct pam_ctxt *ctxt = ctx;
|
||||||
|
|
||||||
debug2("PAM: %s", __func__);
|
debug2("PAM: %s entering, %d responses", __func__, num);
|
||||||
switch (ctxt->pam_done) {
|
switch (ctxt->pam_done) {
|
||||||
case 1:
|
case 1:
|
||||||
sshpam_authenticated = 1;
|
sshpam_authenticated = 1;
|
||||||
|
@ -630,6 +638,7 @@ sshpam_free_ctx(void *ctxtp)
|
||||||
{
|
{
|
||||||
struct pam_ctxt *ctxt = ctxtp;
|
struct pam_ctxt *ctxt = ctxtp;
|
||||||
|
|
||||||
|
debug3("PAM: %s entering", __func__);
|
||||||
sshpam_thread_cleanup();
|
sshpam_thread_cleanup();
|
||||||
xfree(ctxt);
|
xfree(ctxt);
|
||||||
/*
|
/*
|
||||||
|
@ -682,7 +691,7 @@ do_pam_account(void)
|
||||||
return (sshpam_account_status);
|
return (sshpam_account_status);
|
||||||
|
|
||||||
sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
|
sshpam_err = pam_acct_mgmt(sshpam_handle, 0);
|
||||||
debug3("%s: pam_acct_mgmt = %d", __func__, sshpam_err);
|
debug3("PAM: %s pam_acct_mgmt = %d", __func__, sshpam_err);
|
||||||
|
|
||||||
if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD) {
|
if (sshpam_err != PAM_SUCCESS && sshpam_err != PAM_NEW_AUTHTOK_REQD) {
|
||||||
sshpam_account_status = 0;
|
sshpam_account_status = 0;
|
||||||
|
|
Loading…
Reference in New Issue