summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-11-16 10:42:07 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:28:16 -0500
commit3826a6027fa3c7247bbb5084942fed1700f73e90 (patch)
tree0ff0132afe838a03b98072fcbf289841588d7f8a /source4/libcli
parentc7367e873e4896566fb2b954aaadeeef0b734b33 (diff)
downloadsamba-3826a6027fa3c7247bbb5084942fed1700f73e90.tar.gz
samba-3826a6027fa3c7247bbb5084942fed1700f73e90.tar.bz2
samba-3826a6027fa3c7247bbb5084942fed1700f73e90.zip
r19735: report the LDAP error code in the CLDAP replies to the caller
metze (This used to be commit f4a6fade3a3113732ef66433c5739657f0bfdbee)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cldap/cldap.c10
1 files changed, 7 insertions, 3 deletions
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;
}