diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2015-02-23 11:06:25 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-02-25 09:16:46 +0100 |
commit | bdc2aced1185c4ee36921fa01b8dc01789a63900 (patch) | |
tree | 0a7b6ddb16e31b0c167f695cdde5f90c41db8ede /src | |
parent | 889706cbc739358c2a0aac2ba6bc054fdc8e048b (diff) | |
download | sssd-bdc2aced1185c4ee36921fa01b8dc01789a63900.tar.gz sssd-bdc2aced1185c4ee36921fa01b8dc01789a63900.tar.xz sssd-bdc2aced1185c4ee36921fa01b8dc01789a63900.zip |
PAM: print the pam status as string, too
On several places, let's add a pam_strerror() call so that it's easier
to debug user problems.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/providers/data_provider_be.c | 3 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_cmd.c | 3 | ||||
-rw-r--r-- | src/responder/pam/pamsrv_dp.c | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c index 02749035c..47809e20f 100644 --- a/src/providers/data_provider_be.c +++ b/src/providers/data_provider_be.c @@ -536,7 +536,8 @@ static char *dp_pam_err_to_string(TALLOC_CTX *memctx, int dp_err_type, int errnu { switch (dp_err_type) { case DP_ERR_OK: - return talloc_strdup(memctx, "Success"); + return talloc_asprintf(memctx, "Success (%s)", + pam_strerror(NULL, errnum)); break; case DP_ERR_OFFLINE: diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c index ab8369b0f..2ce61881f 100644 --- a/src/responder/pam/pamsrv_cmd.c +++ b/src/responder/pam/pamsrv_cmd.c @@ -562,7 +562,8 @@ static void pam_reply(struct pam_auth_req *preq) } DEBUG(SSSDBG_FUNC_DATA, - "pam_reply called with result [%d].\n", pd->pam_status); + "pam_reply called with result [%d]: %s.\n", + pd->pam_status, pam_strerror(NULL, pd->pam_status)); if (pd->pam_status == PAM_AUTHINFO_UNAVAIL) { switch(pd->cmd) { diff --git a/src/responder/pam/pamsrv_dp.c b/src/responder/pam/pamsrv_dp.c index 8871f198b..826146350 100644 --- a/src/responder/pam/pamsrv_dp.c +++ b/src/responder/pam/pamsrv_dp.c @@ -74,9 +74,11 @@ static void pam_dp_process_reply(DBusPendingCall *pending, void *ptr) preq->pd->pam_status = PAM_SYSTEM_ERR; goto done; } - DEBUG(SSSDBG_CONF_SETTINGS, - "received: [%d][%s]\n", preq->pd->pam_status, preq->pd->domain); - break; + DEBUG(SSSDBG_FUNC_DATA, + "received: [%d (%s)][%s]\n", preq->pd->pam_status, + pam_strerror(NULL, preq->pd->pam_status), + preq->pd->domain); + break; case DBUS_MESSAGE_TYPE_ERROR: DEBUG(SSSDBG_FATAL_FAILURE, "Reply error.\n"); preq->pd->pam_status = PAM_SYSTEM_ERR; |