summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichal Židek <mzidek@redhat.com>2015-08-18 20:39:03 +0200
committerJakub Hrozek <jhrozek@redhat.com>2015-08-19 17:58:27 +0200
commit06987186fb528271d6c208d2abf326049c0e168b (patch)
treea55be6ee66e9bc5fc17a138c40102407da42e5df
parent84493af37d4b57294e94b7bb0596dec51e06b7b0 (diff)
downloadsssd-06987186fb528271d6c208d2abf326049c0e168b.tar.gz
sssd-06987186fb528271d6c208d2abf326049c0e168b.tar.xz
sssd-06987186fb528271d6c208d2abf326049c0e168b.zip
sdap_async: Use specific errmsg when available
Ticket: https://fedorahosted.org/sssd/ticket/2762 Use specific errmsg when ldap returns LDAP_CONSTRAINT_VIOLATION code if that specific message is available. Reviewed-by: Pavel Reichl <preichl@redhat.com>
-rw-r--r--src/providers/ldap/sdap_async.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
index c5be8561a..97c9ea5df 100644
--- a/src/providers/ldap/sdap_async.c
+++ b/src/providers/ldap/sdap_async.c
@@ -648,8 +648,14 @@ static void sdap_exop_modify_passwd_done(struct sdap_op *op,
ret = EOK;
break;
case LDAP_CONSTRAINT_VIOLATION:
- state->user_error_message = talloc_strdup(state,
- "Please make sure the password meets the complexity constraints.");
+ if (errmsg && strlen(errmsg) != 0) {
+ state->user_error_message = talloc_strdup(state, errmsg);
+ } else {
+ 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;