From 5cc28a03659f6b2ae554284800d108a6a70a1041 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 30 May 2006 19:41:29 +0000 Subject: r15964: fix error handling in ldb_ildap backend metze (This used to be commit 54e5aeff87b859960dfc5e4b6e3ab026ce5470ff) --- source4/lib/ldb/ldb_ildap/ldb_ildap.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c index 8929428494..003c6c011e 100644 --- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c +++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c @@ -696,7 +696,7 @@ static int ildb_async_wait(struct ldb_async_handle *handle, enum ldb_async_wait_ return LDB_ERR_OPERATIONS_ERROR; } - return LDB_SUCCESS; + return handle->status; } static int ildb_rootdse_callback(struct ldb_context *ldb, void *context, struct ldb_async_result *ares) @@ -710,14 +710,21 @@ static int ildb_rootdse_callback(struct ldb_context *ldb, void *context, struct ildb = talloc_get_type(context, struct ildb_private); - if (ildb->rootDSE != NULL) { - /* what ? more than one rootdse entry ?! */ - goto error; - } - /* we are interested only in the single reply (rootdse) we receive here */ - if (ares->type == LDB_REPLY_ENTRY) { + switch (ares->type) { + case LDB_REPLY_ENTRY: + if (ildb->rootDSE != NULL) { + /* what ? more than one rootdse entry ?! */ + goto error; + } ildb->rootDSE = talloc_steal(ildb, ares->message); + break; + + case LDB_REPLY_REFERRAL: + goto error; + + case LDB_REPLY_DONE: + break; } talloc_free(ares); -- cgit