From 68f38d6713d4d0faec3364e4ce1fc0bbf1454f7d Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Mon, 3 Aug 2009 12:51:00 -0400 Subject: Fix search replies getting ignored --- server/providers/ldap/sdap_async.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'server/providers/ldap') diff --git a/server/providers/ldap/sdap_async.c b/server/providers/ldap/sdap_async.c index 762cd5ab..ef58f390 100644 --- a/server/providers/ldap/sdap_async.c +++ b/server/providers/ldap/sdap_async.c @@ -215,6 +215,9 @@ static void sdap_process_message(struct sdap_handle *sh, LDAPMessage *msg) switch (msgtype) { case LDAP_RES_SEARCH_ENTRY: + /* go and process entry */ + break; + case LDAP_RES_SEARCH_REFERENCE: /* more ops to come with this msgid */ /* just ignore */ @@ -232,7 +235,6 @@ static void sdap_process_message(struct sdap_handle *sh, LDAPMessage *msg) case LDAP_RES_INTERMEDIATE: /* no more results expected with this msgid */ op->done = true; - ret = EOK; break; default: @@ -242,21 +244,17 @@ static void sdap_process_message(struct sdap_handle *sh, LDAPMessage *msg) return; } - if (ret == EOK) { - reply = talloc(op, struct sdap_msg); - if (!reply) { + reply = talloc(op, struct sdap_msg); + if (!reply) { + ldap_msgfree(msg); + ret = ENOMEM; + } else { + reply->msg = msg; + ret = sdap_msg_attach(reply, msg); + if (ret != EOK) { ldap_msgfree(msg); - ret = ENOMEM; - } else { - reply->msg = msg; - ret = sdap_msg_attach(reply, msg); - if (ret != EOK) { - ldap_msgfree(msg); - talloc_zfree(reply); - } + talloc_zfree(reply); } - } else { - reply = NULL; } /* must be the last operation as it may end up freeing all memory -- cgit