From 3826a6027fa3c7247bbb5084942fed1700f73e90 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 16 Nov 2006 10:42:07 +0000 Subject: r19735: report the LDAP error code in the CLDAP replies to the caller metze (This used to be commit f4a6fade3a3113732ef66433c5739657f0bfdbee) --- source4/libcli/cldap/cldap.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/libcli/cldap') diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c index 94887ef697..9dfa8e81b1 100644 --- a/source4/libcli/cldap/cldap.c +++ b/source4/libcli/cldap/cldap.c @@ -450,7 +450,7 @@ NTSTATUS cldap_search_recv(struct cldap_request *req, if (!ldap_decode(&req->asn1, ldap_msg)) { talloc_free(req); - return NT_STATUS_INVALID_PARAMETER; + return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } ZERO_STRUCT(io->out); @@ -464,13 +464,13 @@ NTSTATUS cldap_search_recv(struct cldap_request *req, /* decode the 2nd part */ if (!ldap_decode(&req->asn1, ldap_msg)) { talloc_free(req); - return NT_STATUS_INVALID_PARAMETER; + return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } } if (ldap_msg->type != LDAP_TAG_SearchResultDone) { talloc_free(req); - return NT_STATUS_UNEXPECTED_NETWORK_ERROR; + return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR); } io->out.result = talloc(mem_ctx, struct ldap_Result); @@ -478,6 +478,10 @@ NTSTATUS cldap_search_recv(struct cldap_request *req, *io->out.result = ldap_msg->r.SearchResultDone; talloc_free(req); + + if (io->out.result->resultcode != LDAP_SUCCESS) { + return NT_STATUS_LDAP(io->out.result->resultcode); + } return NT_STATUS_OK; } -- cgit