Blame SOURCES/0029-LDAP-Return-the-error-message-from-the-extended-oper.patch

5fca41
From 4ab1b754a2659d8e75ae734987ed93f3e1ed047f Mon Sep 17 00:00:00 2001
5fca41
From: Jakub Hrozek <jhrozek@redhat.com>
5fca41
Date: Wed, 15 May 2019 21:20:26 +0200
5fca41
Subject: [PATCH 29/29] LDAP: Return the error message from the extended
5fca41
 operation password change also on failure
5fca41
MIME-Version: 1.0
5fca41
Content-Type: text/plain; charset=UTF-8
5fca41
Content-Transfer-Encoding: 8bit
5fca41
5fca41
Resolves: https://pagure.io/SSSD/sssd/issue/4015
5fca41
5fca41
If password change fails, the tevent request would call
5fca41
TEVENT_REQ_RETURN_ON_ERROR before returning the error message that comes
5fca41
from the server, so the server message would not be propagated to the caller.
5fca41
5fca41
This regressed in cf1d7ff
5fca41
5fca41
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
5fca41
(cherry picked from commit 9a4d5f0601b432b87c3bf93f7126d07e65993e0d)
5fca41
---
5fca41
 src/providers/ldap/ldap_auth.c  | 5 +++--
5fca41
 src/providers/ldap/sdap_async.c | 1 +
5fca41
 2 files changed, 4 insertions(+), 2 deletions(-)
5fca41
5fca41
diff --git a/src/providers/ldap/ldap_auth.c b/src/providers/ldap/ldap_auth.c
5fca41
index 86724e388..4f416c1aa 100644
5fca41
--- a/src/providers/ldap/ldap_auth.c
5fca41
+++ b/src/providers/ldap/ldap_auth.c
5fca41
@@ -1212,10 +1212,11 @@ sdap_pam_change_password_recv(TALLOC_CTX *mem_ctx,
5fca41
     struct sdap_pam_change_password_state *state;
5fca41
     state = tevent_req_data(req, struct sdap_pam_change_password_state);
5fca41
 
5fca41
-    TEVENT_REQ_RETURN_ON_ERROR(req);
5fca41
-
5fca41
+    /* We want to return the error message even on failure */
5fca41
     *_user_error_message = talloc_steal(mem_ctx, state->user_error_message);
5fca41
 
5fca41
+    TEVENT_REQ_RETURN_ON_ERROR(req);
5fca41
+
5fca41
     return EOK;
5fca41
 }
5fca41
 
5fca41
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
5fca41
index 822baf06a..7e78e6b6e 100644
5fca41
--- a/src/providers/ldap/sdap_async.c
5fca41
+++ b/src/providers/ldap/sdap_async.c
5fca41
@@ -696,6 +696,7 @@ errno_t sdap_exop_modify_passwd_recv(struct tevent_req *req,
5fca41
     struct sdap_exop_modify_passwd_state *state = tevent_req_data(req,
5fca41
                                          struct sdap_exop_modify_passwd_state);
5fca41
 
5fca41
+    /* We want to return the error message even on failure */
5fca41
     *user_error_message = talloc_steal(mem_ctx, state->user_error_message);
5fca41
 
5fca41
     TEVENT_REQ_RETURN_ON_ERROR(req);
5fca41
-- 
5fca41
2.20.1
5fca41