sssd/0004-PAM-check-return-value-of-confdb_get_string.patch

34 lines
1.2 KiB
Diff

From 45b7cadbbd81df4a6aba39de97eb1522774bcc60 Mon Sep 17 00:00:00 2001
From: Pavel Reichl <preichl@redhat.com>
Date: Wed, 25 Feb 2015 05:38:38 -0500
Subject: [PATCH 04/99] PAM: check return value of confdb_get_string
Coverity found this neglect.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit c5290f2175845f2c5e3f35ce279b6f52b1d51275)
---
src/responder/pam/pamsrv_cmd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/responder/pam/pamsrv_cmd.c b/src/responder/pam/pamsrv_cmd.c
index ab8369b0f9b1f3ed9256fc16396f095818d36bbf..86e763f825096edc0c07adbe2e02820e5f2bdac9 100644
--- a/src/responder/pam/pamsrv_cmd.c
+++ b/src/responder/pam/pamsrv_cmd.c
@@ -679,6 +679,12 @@ static void pam_reply(struct pam_auth_req *preq)
ret = confdb_get_string(pctx->rctx->cdb, pd, CONFDB_PAM_CONF_ENTRY,
CONFDB_PAM_ACCOUNT_EXPIRED_MESSAGE, "",
&pam_account_expired_message);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_MINOR_FAILURE,
+ "Failed to get expiration message: %d:[%s].\n",
+ ret, sss_strerror(ret));
+ goto done;
+ }
inform_account_expired(pd, pam_account_expired_message);
}
--
2.4.0