summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-05-30 19:41:29 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:45 -0500
commit5cc28a03659f6b2ae554284800d108a6a70a1041 (patch)
treef4087569413062e957c9e2cf4bfd058bc992aff2
parenta6c4541fdf19f0a5505d23142dbb1fa6af855c6c (diff)
downloadsamba-5cc28a03659f6b2ae554284800d108a6a70a1041.tar.gz
samba-5cc28a03659f6b2ae554284800d108a6a70a1041.tar.bz2
samba-5cc28a03659f6b2ae554284800d108a6a70a1041.zip
r15964: fix error handling in ldb_ildap backend
metze (This used to be commit 54e5aeff87b859960dfc5e4b6e3ab026ce5470ff)
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c21
1 files 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);