summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/ldap/ldap_ildap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/libcli/ldap/ldap_ildap.c b/source4/libcli/ldap/ldap_ildap.c
index cfcb79f64f..541797c25c 100644
--- a/source4/libcli/ldap/ldap_ildap.c
+++ b/source4/libcli/ldap/ldap_ildap.c
@@ -189,6 +189,12 @@ NTSTATUS ildap_search(struct ldap_connection *conn, const char *basedn,
struct ldap_message *res;
status = ldap_result_n(req, i, &res);
if (!NT_STATUS_IS_OK(status)) break;
+
+ if (res->type == LDAP_TAG_SearchResultDone) {
+ status = ldap_check_response(conn, &res->r.GeneralResult);
+ break;
+ }
+
if (res->type != LDAP_TAG_SearchResultEntry) continue;
(*results) = talloc_realloc(conn, *results, struct ldap_message *, n+2);