diff options
author | Andrew Tridgell <tridge@samba.org> | 2006-10-14 04:43:51 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2006-10-14 04:43:51 +0000 |
commit | c98a8c4589e10ffc601c6c0fe31f79ece95ec5ae (patch) | |
tree | dd2131b370151720c381c89a747c6def763cd558 /source/lib/ldb/ldb_ldap | |
parent | 8c8ce2446c81e284c94bce3081d413e2d3fe67e2 (diff) | |
download | samba-c98a8c4589e10ffc601c6c0fe31f79ece95ec5ae.tar.gz samba-c98a8c4589e10ffc601c6c0fe31f79ece95ec5ae.tar.xz samba-c98a8c4589e10ffc601c6c0fe31f79ece95ec5ae.zip |
r19273: - fixed error handling with the ldap backend
- propogate errors to the ldbadd command line tool
- use the rdn_name module when testing the tdb backend to allow the
same test code to correctly test the ldap and non-ldap backends
Diffstat (limited to 'source/lib/ldb/ldb_ldap')
-rw-r--r-- | source/lib/ldb/ldb_ldap/ldb_ldap.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/lib/ldb/ldb_ldap/ldb_ldap.c b/source/lib/ldb/ldb_ldap/ldb_ldap.c index 10563816b97..a34e35c6db3 100644 --- a/source/lib/ldb/ldb_ldap/ldb_ldap.c +++ b/source/lib/ldb/ldb_ldap/ldb_ldap.c @@ -497,9 +497,11 @@ static int lldb_parse_result(struct ldb_handle *handle, LDAPMessage *result) char **referralsp = NULL; LDAPControl **serverctrlsp = NULL; int ret = LDB_SUCCESS; - + type = ldap_msgtype(result); + handle->status = 0; + switch (type) { case LDAP_RES_SEARCH_ENTRY: @@ -631,15 +633,19 @@ static int lldb_parse_result(struct ldb_handle *handle, LDAPMessage *result) } if (matcheddnp) ldap_memfree(matcheddnp); - if (errmsgp) { + if (errmsgp && *errmsgp) { ldb_set_errstring(ac->module->ldb, errmsgp); + } else if (handle->status) { + ldb_set_errstring(ac->module->ldb, ldap_err2string(handle->status)); + } + if (errmsgp) { ldap_memfree(errmsgp); } if (referralsp) ldap_value_free(referralsp); if (serverctrlsp) ldap_controls_free(serverctrlsp); ldap_msgfree(result); - return ret; + return lldb_ldap_to_ldb(handle->status); error: handle->state = LDB_ASYNC_DONE; |