summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async.c
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-07-15 13:44:31 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-08-11 22:51:25 +0200
commitcc0a816d8a345398d900bc006e73d10049f0c38a (patch)
tree76e441aa8182b8b1c2144cdea15e281e2a6ab95e /src/providers/ldap/sdap_async.c
parent08621da018967898b21739e24eff173c18ecdd91 (diff)
downloadsssd-1.9.2-121.el6.tar.gz
sssd-1.9.2-121.el6.tar.xz
sssd-1.9.2-121.el6.zip
print hint about password complexity when new password is rejectedsssd-1.9.2-121.el6
https://fedorahosted.org/sssd/ticket/1827
Diffstat (limited to 'src/providers/ldap/sdap_async.c')
-rw-r--r--src/providers/ldap/sdap_async.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index 57c11f30c..2ab61532e 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -641,7 +641,21 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op,
DEBUG(3, ("ldap_extended_operation result: %s(%d), %s\n",
sss_ldap_err2string(state->result), state->result, errmsg));
- if (state->result != LDAP_SUCCESS) {
+ switch (state->result) {
+ case LDAP_SUCCESS:
+ ret = EOK;
+ break;
+ case LDAP_CONSTRAINT_VIOLATION:
+ state->user_error_message = talloc_strdup(state,
+ "Please make sure the password meets the complexity constraints.");
+ if (state->user_error_message == NULL) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("talloc_strdup failed\n"));
+ ret = ENOMEM;
+ goto done;
+ }
+ ret = EIO;
+ goto done;
+ default:
if (errmsg) {
state->user_error_message = talloc_strdup(state, errmsg);
if (state->user_error_message == NULL) {