summaryrefslogtreecommitdiff
path: root/source4/libcli/ldap
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-03-08 06:23:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:24 -0500
commit3370f2f2d7e5296e8f54f721003c07fac111d1ad (patch)
tree8149619a220e76f7904d04b163e792dac50749ad /source4/libcli/ldap
parentf80d21069b7e22fbe8abdd59e7acb748f0a6b1ce (diff)
downloadsamba-3370f2f2d7e5296e8f54f721003c07fac111d1ad.tar.gz
samba-3370f2f2d7e5296e8f54f721003c07fac111d1ad.tar.bz2
samba-3370f2f2d7e5296e8f54f721003c07fac111d1ad.zip
r21761: - Give more detail on LDAP client library failures (make it clear
where the error is from) - Make default error string more consistant Andrew Bartlett (This used to be commit 7f115579d20a3112efd11444fafcbf78698fc9a1)
Diffstat (limited to 'source4/libcli/ldap')
-rw-r--r--source4/libcli/ldap/ldap_client.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index 2c2cd0dd66..82cafd721a 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -562,6 +562,7 @@ struct ldap_request *ldap_request_send(struct ldap_connection *conn,
msg->messageid = req->messageid;
if (!ldap_encode(msg, &req->data, req)) {
+ status = NT_STATUS_INTERNAL_ERROR;
goto failed;
}
@@ -704,12 +705,14 @@ NTSTATUS ldap_check_response(struct ldap_connection *conn, struct ldap_Result *r
/*
return error string representing the last error
*/
-const char *ldap_errstr(struct ldap_connection *conn, NTSTATUS status)
+const char *ldap_errstr(struct ldap_connection *conn,
+ TALLOC_CTX *mem_ctx,
+ NTSTATUS status)
{
if (NT_STATUS_IS_LDAP(status) && conn->last_error != NULL) {
- return conn->last_error;
+ return talloc_strdup(mem_ctx, conn->last_error);
}
- return nt_errstr(status);
+ return talloc_asprintf(mem_ctx, "LDAP client internal error: %s", nt_errstr(status));
}