mirror of
https://gitlab.com/openconnect/ocserv.git
synced 2026-02-10 08:46:58 +08:00
better messages from pam authentication module
This commit is contained in:
13
src/pam.c
13
src/pam.c
@@ -90,7 +90,6 @@ unsigned i;
|
||||
pctx->sent_msg = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
switch (msg[i]->msg_style) {
|
||||
case PAM_PROMPT_ECHO_OFF:
|
||||
@@ -170,7 +169,7 @@ struct pam_ctx_st * pctx;
|
||||
pctx->dc.appdata_ptr = pctx;
|
||||
pret = pam_start(PACKAGE, user, &pctx->dc, &pctx->ph);
|
||||
if (pret != PAM_SUCCESS) {
|
||||
syslog(LOG_AUTH, "Error in PAM authentication initialization: %s", pam_strerror(pctx->ph, pret));
|
||||
syslog(LOG_AUTH, "PAM-auth init: %s", pam_strerror(pctx->ph, pret));
|
||||
goto fail1;
|
||||
}
|
||||
|
||||
@@ -200,7 +199,7 @@ struct pam_ctx_st * pctx = ctx;
|
||||
int size;
|
||||
|
||||
if (pctx->state != PAM_S_INIT && pctx->state != PAM_S_WAIT_FOR_PASS) {
|
||||
syslog(LOG_AUTH, "PAM conversation in wrong state (%d)", pctx->state);
|
||||
syslog(LOG_AUTH, "PAM-auth: conversation in wrong state (%d)", pctx->state);
|
||||
return ERR_AUTH_FAIL;
|
||||
}
|
||||
|
||||
@@ -210,7 +209,7 @@ int size;
|
||||
co_call(pctx->cr);
|
||||
|
||||
if (pctx->cr_ret != PAM_SUCCESS) {
|
||||
syslog(LOG_AUTH, "Error in PAM authentication: %s", pam_strerror(pctx->ph, pctx->cr_ret));
|
||||
syslog(LOG_AUTH, "PAM-auth: %s", pam_strerror(pctx->ph, pctx->cr_ret));
|
||||
return ERR_AUTH_FAIL;
|
||||
}
|
||||
}
|
||||
@@ -241,7 +240,7 @@ struct pam_ctx_st * pctx = ctx;
|
||||
return -1;
|
||||
|
||||
if (pctx->state != PAM_S_WAIT_FOR_PASS) {
|
||||
syslog(LOG_AUTH, "PAM conversation in wrong state (%d/expecting %d)", pctx->state, PAM_S_WAIT_FOR_PASS);
|
||||
syslog(LOG_AUTH, "PAM auth: conversation in wrong state (%d/expecting %d)", pctx->state, PAM_S_WAIT_FOR_PASS);
|
||||
return ERR_AUTH_FAIL;
|
||||
}
|
||||
|
||||
@@ -252,7 +251,7 @@ struct pam_ctx_st * pctx = ctx;
|
||||
co_call(pctx->cr);
|
||||
|
||||
if (pctx->cr_ret != PAM_SUCCESS) {
|
||||
syslog(LOG_AUTH, "Error in PAM authentication: %s", pam_strerror(pctx->ph, pctx->cr_ret));
|
||||
syslog(LOG_AUTH, "PAM-auth: %s", pam_strerror(pctx->ph, pctx->cr_ret));
|
||||
return ERR_AUTH_FAIL;
|
||||
}
|
||||
|
||||
@@ -290,7 +289,7 @@ int pret;
|
||||
|
||||
pret = pam_get_item(pctx->ph, PAM_USER, (const void **)&user);
|
||||
if (pret != PAM_SUCCESS) {
|
||||
/*syslog(LOG_AUTH, "Error in pam_get_item(PAM_USER): %s", pam_strerror(pctx->ph, pret));*/
|
||||
/*syslog(LOG_AUTH, "PAM-auth: pam_get_item(PAM_USER): %s", pam_strerror(pctx->ph, pret));*/
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user