summaryrefslogtreecommitdiffstats
path: root/src/providers/krb5/krb5_child.c
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2013-08-09 15:17:48 -0400
committerJakub Hrozek <jhrozek@redhat.com>2013-08-11 22:35:53 +0200
commit08621da018967898b21739e24eff173c18ecdd91 (patch)
treed02eb6a7bb257cc7508bf1538c78529b9ce5a541 /src/providers/krb5/krb5_child.c
parentdf4bb9a21df03787383b8f684afbe04750368280 (diff)
downloadsssd-08621da018967898b21739e24eff173c18ecdd91.tar.gz
sssd-08621da018967898b21739e24eff173c18ecdd91.tar.xz
sssd-08621da018967898b21739e24eff173c18ecdd91.zip
ldap, krb5: More descriptive msg on chpass failure.sssd-1.9.2-120.el6
Print more descriptive message when wrong current password is given during password change operation. resolves: https://fedorahosted.org/sssd/ticket/2029
Diffstat (limited to 'src/providers/krb5/krb5_child.c')
-rw-r--r--src/providers/krb5/krb5_child.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c
index cd6f7e34a..73575b88b 100644
--- a/src/providers/krb5/krb5_child.c
+++ b/src/providers/krb5/krb5_child.c
@@ -1079,6 +1079,8 @@ static errno_t changepw_child(int fd, struct krb5_req *kr)
const char *realm_name;
int realm_length;
krb5_get_init_creds_opt *chagepw_options;
+ size_t msg_len;
+ uint8_t *msg;
DEBUG(SSSDBG_TRACE_LIBS, ("Password change operation\n"));
@@ -1117,6 +1119,20 @@ static errno_t changepw_child(int fd, struct krb5_req *kr)
chagepw_options);
sss_krb5_get_init_creds_opt_free(kr->ctx, chagepw_options);
if (kerr != 0) {
+ ret = pack_user_info_chpass_error(kr->pd, "Old password not accepted.",
+ &msg_len, &msg);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("pack_user_info_chpass_error failed.\n"));
+ } else {
+ ret = pam_add_response(kr->pd, SSS_PAM_USER_INFO, msg_len,
+ msg);
+ if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ ("pam_add_response failed.\n"));
+ }
+ }
+
pam_status = kerr_handle_error(kerr);
goto sendresponse;
}