1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-02 20:23:50 +03:00

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 commit is contained in:
Andrew Bartlett
2007-03-08 06:23:39 +00:00
committed by Gerald (Jerry) Carter
parent 2e85b1583b
commit 7f115579d2
4 changed files with 18 additions and 9 deletions

View File

@@ -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));
}