better messages from pam authentication module

This commit is contained in:
Nikos Mavrogiannopoulos
2014-02-18 18:39:44 +01:00
parent d361bd608d
commit b550489c88

View File

@@ -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;
}