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

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