|
|
7db20e |
From 5b5cb000d63c3edad40ebb420776df2a18950fcb Mon Sep 17 00:00:00 2001
|
|
|
7db20e |
From: Jakub Hrozek <jhrozek@redhat.com>
|
|
|
7db20e |
Date: Wed, 10 Sep 2014 11:55:24 +0200
|
|
|
7db20e |
Subject: [PATCH 129/130] Ignore referrals in deref and ASQ, too
|
|
|
7db20e |
MIME-Version: 1.0
|
|
|
7db20e |
Content-Type: text/plain; charset=UTF-8
|
|
|
7db20e |
Content-Transfer-Encoding: 8bit
|
|
|
7db20e |
|
|
|
7db20e |
Reviewed-by: Michal Židek <mzidek@redhat.com>
|
|
|
7db20e |
---
|
|
|
7db20e |
src/providers/ldap/sdap_async.c | 20 ++++++++++++++++++--
|
|
|
7db20e |
1 file changed, 18 insertions(+), 2 deletions(-)
|
|
|
7db20e |
|
|
|
7db20e |
diff --git a/src/providers/ldap/sdap_async.c b/src/providers/ldap/sdap_async.c
|
|
|
7db20e |
index 7db01d979ee81a3707126a4c3eb1f36006e8b392..b06d94bfd9d1a60f587de5c807389c74f908af5e 100644
|
|
|
7db20e |
--- a/src/providers/ldap/sdap_async.c
|
|
|
7db20e |
+++ b/src/providers/ldap/sdap_async.c
|
|
|
7db20e |
@@ -1622,6 +1622,7 @@ static errno_t sdap_x_deref_parse_entry(struct sdap_handle *sh,
|
|
|
7db20e |
struct sdap_x_deref_search_state {
|
|
|
7db20e |
struct sdap_handle *sh;
|
|
|
7db20e |
struct sdap_op *op;
|
|
|
7db20e |
+ struct sdap_options *opts;
|
|
|
7db20e |
struct sdap_attr_map_info *maps;
|
|
|
7db20e |
LDAPControl **ctrls;
|
|
|
7db20e |
|
|
|
7db20e |
@@ -1647,6 +1648,7 @@ sdap_x_deref_search_send(TALLOC_CTX *memctx, struct tevent_context *ev,
|
|
|
7db20e |
state->sh = sh;
|
|
|
7db20e |
state->maps = maps;
|
|
|
7db20e |
state->op = NULL;
|
|
|
7db20e |
+ state->opts = opts;
|
|
|
7db20e |
state->num_maps = num_maps;
|
|
|
7db20e |
state->ctrls = talloc_zero_array(state, LDAPControl *, 2);
|
|
|
7db20e |
if (state->ctrls == NULL) {
|
|
|
7db20e |
@@ -1797,11 +1799,18 @@ static void sdap_x_deref_search_done(struct tevent_req *subreq)
|
|
|
7db20e |
{
|
|
|
7db20e |
struct tevent_req *req = tevent_req_callback_data(subreq,
|
|
|
7db20e |
struct tevent_req);
|
|
|
7db20e |
+ struct sdap_x_deref_search_state *state = tevent_req_data(req,
|
|
|
7db20e |
+ struct sdap_x_deref_search_state);
|
|
|
7db20e |
int ret;
|
|
|
7db20e |
|
|
|
7db20e |
ret = sdap_get_generic_ext_recv(subreq);
|
|
|
7db20e |
talloc_zfree(subreq);
|
|
|
7db20e |
- if (ret) {
|
|
|
7db20e |
+ if (ret == ERR_REFERRAL) {
|
|
|
7db20e |
+ if (dp_opt_get_bool(state->opts->basic, SDAP_REFERRALS)) {
|
|
|
7db20e |
+ tevent_req_error(req, ret);
|
|
|
7db20e |
+ return;
|
|
|
7db20e |
+ }
|
|
|
7db20e |
+ } else if (ret) {
|
|
|
7db20e |
DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n",
|
|
|
7db20e |
ret, sss_strerror(ret)));
|
|
|
7db20e |
tevent_req_error(req, ret);
|
|
|
7db20e |
@@ -2056,11 +2065,18 @@ static void sdap_asq_search_done(struct tevent_req *subreq)
|
|
|
7db20e |
{
|
|
|
7db20e |
struct tevent_req *req = tevent_req_callback_data(subreq,
|
|
|
7db20e |
struct tevent_req);
|
|
|
7db20e |
+ struct sdap_asq_search_state *state =
|
|
|
7db20e |
+ tevent_req_data(req, struct sdap_asq_search_state);
|
|
|
7db20e |
int ret;
|
|
|
7db20e |
|
|
|
7db20e |
ret = sdap_get_generic_ext_recv(subreq);
|
|
|
7db20e |
talloc_zfree(subreq);
|
|
|
7db20e |
- if (ret) {
|
|
|
7db20e |
+ if (ret == ERR_REFERRAL) {
|
|
|
7db20e |
+ if (dp_opt_get_bool(state->opts->basic, SDAP_REFERRALS)) {
|
|
|
7db20e |
+ tevent_req_error(req, ret);
|
|
|
7db20e |
+ return;
|
|
|
7db20e |
+ }
|
|
|
7db20e |
+ } else if (ret) {
|
|
|
7db20e |
DEBUG(4, ("sdap_get_generic_ext_recv failed [%d]: %s\n",
|
|
|
7db20e |
ret, sss_strerror(ret)));
|
|
|
7db20e |
tevent_req_error(req, ret);
|
|
|
7db20e |
--
|
|
|
7db20e |
1.9.3
|
|
|
7db20e |
|