URL: https://github.com/SSSD/sssd/pull/817 Author: jhrozek Title: #817: LDAP: Return the error message from the extdom password change also on failure Action: opened
PR body: """ Resolves: https://pagure.io/SSSD/sssd/issue/4015 If password change fails, the tevent request would call TEVENT_REQ_RETURN_ON_ERROR before returning the error message that comes from the server, so the server message would not be propagated to the caller. This regressed in cf1d7ff """ To pull the PR as Git branch: git remote add ghsssd https://github.com/SSSD/sssd git fetch ghsssd pull/817/head:pr817 git checkout pr817
From 43edc0896481799d3a3837f9e0bf41248067c2e4 Mon Sep 17 00:00:00 2001 From: Jakub Hrozek <jhro...@redhat.com> Date: Wed, 15 May 2019 21:20:26 +0200 Subject: [PATCH] LDAP: Return the error message from the extdom password change also on failure Resolves: https://pagure.io/SSSD/sssd/issue/4015 If password change fails, the tevent request would call TEVENT_REQ_RETURN_ON_ERROR before returning the error message that comes from the server, so the server message would not be propagated to the caller. This regressed in cf1d7ff --- src/providers/ldap/ldap_auth.c | 5 +++-- src/providers/ldap/sdap_async.c | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c index 9d06dd037f..664f1b0583 100644 --- a/src/providers/ldap/ldap_auth.c +++ b/src/providers/ldap/ldap_auth.c @@ -1222,10 +1222,11 @@ sdap_pam_change_password_recv(TALLOC_CTX *mem_ctx, struct sdap_pam_change_password_state *state; state = tevent_req_data(req, struct sdap_pam_change_password_state); - TEVENT_REQ_RETURN_ON_ERROR(req); - + /* We want to return the error message even on failure */ *_user_error_message = talloc_steal(mem_ctx, state->user_error_message); + TEVENT_REQ_RETURN_ON_ERROR(req); + return EOK; } diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c index ae502745c3..2513e27e0d 100644 --- a/src/providers/ldap/sdap_async.c +++ b/src/providers/ldap/sdap_async.c @@ -696,6 +696,7 @@ errno_t sdap_exop_modify_passwd_recv(struct tevent_req *req, struct sdap_exop_modify_passwd_state *state = tevent_req_data(req, struct sdap_exop_modify_passwd_state); + /* We want to return the error message even on failure */ *user_error_message = talloc_steal(mem_ctx, state->user_error_message); TEVENT_REQ_RETURN_ON_ERROR(req);
_______________________________________________ sssd-devel mailing list -- sssd-devel@lists.fedorahosted.org To unsubscribe send an email to sssd-devel-le...@lists.fedorahosted.org Fedora Code of Conduct: https://getfedora.org/code-of-conduct.html List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedorahosted.org/archives/list/sssd-devel@lists.fedorahosted.org