[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-41-g9cb1a33

Ronnie Sahlberg sahlberg at samba.org
Mon Feb 22 18:51:17 MST 2010


The branch, 1.0.112 has been updated
       via  9cb1a3393efc479494de11839cfd3b080b7c8914 (commit)
      from  4e31db4bc21a84e6003258b924d73782030c53ed (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.0.112


- Log -----------------------------------------------------------------
commit 9cb1a3393efc479494de11839cfd3b080b7c8914
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Tue Feb 23 12:43:49 2010 +1100

    In ctdb_control_end_recovery,
    
    We used to talloc_steal c (the command packet) and make it a child of the
    "event script state context".
    If we failed to create a eventscript child context for some reason,
    this would have talloc freed state, but at the same time it would also
    implicitely have freed c.
    Once ctdb_control_end_recovery() returns the error back to the caller,
    the caller would dereference both c, and also outdata which is a child of c
    and we would either read garbage data or segv.
    
    Change the ordering so we only talloc_steal c as a child of state IFF
    we have successfully created a child context for the script.
    
    BZ61068

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

Summary of changes:
 server/ctdb_recover.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 9020363..ed5c22b 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -967,7 +967,7 @@ int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
 	state = talloc(ctdb, struct recovery_callback_state);
 	CTDB_NO_MEMORY(ctdb, state);
 
-	state->c    = talloc_steal(state, c);
+	state->c    = c;
 
 	ctdb_disable_monitoring(ctdb);
 
@@ -986,6 +986,7 @@ int32_t ctdb_control_end_recovery(struct ctdb_context *ctdb,
 	}
 
 	/* tell the control that we will be reply asynchronously */
+	state->c    = talloc_steal(state, c);
 	*async_reply = true;
 	return 0;
 }


-- 
CTDB repository


More information about the samba-cvs mailing list