[SCM] Samba Shared Repository - branch v4-0-test updated - release-4-0-0alpha4-86-gacbe365

Simo Sorce idra at samba.org
Sun Jun 15 19:06:58 GMT 2008


The branch, v4-0-test has been updated
       via  acbe365e34571218fe312f52edec98f4fe5b76be (commit)
       via  10ffa87b6b7ebfe51e81819feb93a72e9ec10418 (commit)
      from  1659a572c49b2f9cf336b27ec1c1bec1b86d688e (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v4-0-test


- Log -----------------------------------------------------------------
commit acbe365e34571218fe312f52edec98f4fe5b76be
Author: Simo Sorce <idra at samba.org>
Date:   Sun Jun 15 11:15:12 2008 -0400

    Fix cleanup.

commit 10ffa87b6b7ebfe51e81819feb93a72e9ec10418
Author: Simo Sorce <idra at samba.org>
Date:   Sun Jun 15 11:11:14 2008 -0400

    Note that making ldb the event context parent seem to lead to races when
    freeing up resources. Try to avoid races by making the autofree context
    be the parent of the event system

-----------------------------------------------------------------------

Summary of changes:
 source/lib/ldb/common/ldb.c          |    2 +-
 source/lib/ldb/ldb_ildap/ldb_ildap.c |   13 +++++++++----
 2 files changed, 10 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/lib/ldb/common/ldb.c b/source/lib/ldb/common/ldb.c
index 22cd46d..d0570c5 100644
--- a/source/lib/ldb/common/ldb.c
+++ b/source/lib/ldb/common/ldb.c
@@ -48,7 +48,7 @@ struct ldb_context *ldb_init(TALLOC_CTX *mem_ctx, struct event_context *ev_ctx)
 	/* FIXME: Hack a new event context so that CMD line utilities work
 	 * until we have them all converted */
 	if (ev_ctx == NULL) {
-		ev_ctx = event_context_init(ldb);
+		ev_ctx = event_context_init(talloc_autofree_context());
 	}
 
 	ret = ldb_setup_wellknown_attributes(ldb);
diff --git a/source/lib/ldb/ldb_ildap/ldb_ildap.c b/source/lib/ldb/ldb_ildap/ldb_ildap.c
index f0a34b6..5ad671e 100644
--- a/source/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -146,7 +146,10 @@ static void ildb_request_timeout(struct event_context *ev,
 				 struct timeval t, void *private_data)
 {
 	struct ildb_context *ac;
-	struct ldb_handle *handle = ac->handle;
+	struct ldb_handle *handle;
+
+	ac = talloc_get_type(private_data, struct ildb_context);
+	handle = ac->handle;
 
 	ac = talloc_get_type(private_data, struct ildb_context);
 
@@ -162,12 +165,14 @@ static void ildb_request_timeout(struct event_context *ev,
 static void ildb_callback(struct ldap_request *req)
 {
 	struct ildb_context *ac;
-	struct ldb_handle *handle = ac->handle;
-	struct ildb_private *ildb = ac->ildb;
+	struct ldb_handle *handle;
+	struct ildb_private *ildb;
 	NTSTATUS status;
 	int i;
 
-	ac =talloc_get_type(req->async.private_data, struct ildb_context);
+	ac = talloc_get_type(req->async.private_data, struct ildb_context);
+	ildb = ac->ildb;
+	handle = ac->handle;
 	handle->status = LDB_SUCCESS;
 
 	if (!NT_STATUS_IS_OK(req->status)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list