From b550489c886458f046361c4caff8958281c351f4 Mon Sep 17 00:00:00 2001 From: Nikos Mavrogiannopoulos Date: Tue, 18 Feb 2014 18:39:44 +0100 Subject: [PATCH] better messages from pam authentication module --- src/pam.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/pam.c b/src/pam.c index 5737dd7a..e2c9329a 100644 --- a/src/pam.c +++ b/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; }