summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-06-20 05:04:45 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:18:35 -0500
commite3eec57b06f7e0f7c6c3e4dbbc814db27cc19a25 (patch)
tree0eca8800458e59e10cbcbbc2cbb99b525777874c
parent545203d9154a9ce0f5cc3800796581f62380074b (diff)
downloadsamba-e3eec57b06f7e0f7c6c3e4dbbc814db27cc19a25.tar.gz
samba-e3eec57b06f7e0f7c6c3e4dbbc814db27cc19a25.tar.bz2
samba-e3eec57b06f7e0f7c6c3e4dbbc814db27cc19a25.zip
r7779: use the parent event context in ldb_wrap_connect(). See the comment in
the previous commit for the method. (This used to be commit b0ad505510b9df8e7f05fb646046114eb6b997ed)
-rw-r--r--source4/lib/db_wrap.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/lib/db_wrap.c b/source4/lib/db_wrap.c
index 33c2af2851..c277f2d975 100644
--- a/source4/lib/db_wrap.c
+++ b/source4/lib/db_wrap.c
@@ -82,6 +82,8 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
struct ldb_context *ldb;
struct ldb_wrap *w;
int ret;
+ struct event_context *ev;
+
for (w = ldb_list; w; w = w->next) {
if (strcmp(url, w->url) == 0) {
@@ -93,6 +95,14 @@ struct ldb_context *ldb_wrap_connect(TALLOC_CTX *mem_ctx,
if (ldb == NULL) {
return NULL;
}
+
+ /* we want to use the existing event context if possible. This
+ relies on the fact that in smbd, everything is a child of
+ the main event_context */
+ ev = talloc_find_parent_bytype(mem_ctx, struct event_context);
+ if (ev) {
+ ldb_set_opaque(ldb, "EventContext", ev);
+ }
ret = ldb_connect(ldb, url, flags, options);
if (ret == -1) {