diff options
author | Pavel Březina <pbrezina@redhat.com> | 2013-07-15 13:44:31 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-08-11 22:45:55 +0200 |
commit | 658e2757fa9559f5dff6d475ae50496429e3d89f (patch) | |
tree | c7faada09418c6d2c60abb2c4599ac6b6ade9610 /src/providers/krb5/krb5_child.c | |
parent | f4f0a4c2af6e1b7bb47a3f312718910efff731cf (diff) | |
download | sssd-658e2757fa9559f5dff6d475ae50496429e3d89f.tar.gz sssd-658e2757fa9559f5dff6d475ae50496429e3d89f.tar.xz sssd-658e2757fa9559f5dff6d475ae50496429e3d89f.zip |
print hint about password complexity when new password is rejected
https://fedorahosted.org/sssd/ticket/1827
Diffstat (limited to 'src/providers/krb5/krb5_child.c')
-rw-r--r-- | src/providers/krb5/krb5_child.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/providers/krb5/krb5_child.c b/src/providers/krb5/krb5_child.c index 73575b88b..e4dc49327 100644 --- a/src/providers/krb5/krb5_child.c +++ b/src/providers/krb5/krb5_child.c @@ -1185,7 +1185,7 @@ static errno_t changepw_child(int fd, struct krb5_req *kr) } } - if (result_string.length > 0) { + if (result_string.length > 0 && result_string.data[0] != '\0') { DEBUG(1, ("krb5_change_password failed [%d][%.*s].\n", result_code, result_string.length, result_string.data)); talloc_free(user_error_message); @@ -1194,6 +1194,12 @@ static errno_t changepw_child(int fd, struct krb5_req *kr) if (user_error_message == NULL) { DEBUG(1, ("talloc_strndup failed.\n")); } + } else if (result_code == KRB5_KPASSWD_SOFTERROR) { + user_error_message = talloc_strdup(kr->pd, "Please make sure the " + "password meets the complexity constraints."); + if (user_error_message == NULL) { + DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strndup failed.\n")); + } } if (user_error_message != NULL) { |