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

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
This commit is contained in:
Andrew Tridgell
2006-10-14 04:43:51 +00:00
committed by Gerald (Jerry) Carter
parent 0546f487f4
commit dd82c474a1
5 changed files with 37 additions and 20 deletions

View File

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