[SCM] SAMBA-CTDB repository - branch v3-4-ctdb updated - 3.4.2-ctdb-17-4-g4ef17d9

Michael Adam obnox at samba.org
Mon Jan 18 09:36:58 MST 2010


The branch, v3-4-ctdb has been updated
       via  4ef17d96be14e61a1ee3cbdeb806f9bfaf4b0057 (commit)
      from  d26d1e48f5029640cda6eacf12144532a5b43d98 (commit)

http://gitweb.samba.org/?p=obnox/samba-ctdb.git;a=shortlog;h=v3-4-ctdb


- Log -----------------------------------------------------------------
commit 4ef17d96be14e61a1ee3cbdeb806f9bfaf4b0057
Author: Michael Adam <obnox at samba.org>
Date:   Mon Jan 18 17:26:04 2010 +0100

    s3:dbwrap_ctdb: fix reading/storing of special key __db_sequence_number__
    
    The key for reading and writing was inconsistent due to a
    off by one data length.
    
    Michael

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

Summary of changes:
 source3/lib/dbwrap_ctdb.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 79c4c0c..ddc8868 100644
--- a/source3/lib/dbwrap_ctdb.c
+++ b/source3/lib/dbwrap_ctdb.c
@@ -688,8 +688,7 @@ static NTSTATUS db_ctdb_fetch_db_seqnum_from_db(struct db_ctdb_ctx *db,
 		return NT_STATUS_INVALID_PARAMETER;
 	}
 
-	key.dptr = (uint8_t *)discard_const(keyname);
-	key.dsize = strlen(keyname) + 1;
+	key = string_term_tdb_data(keyname);
 
 	status = db_ctdb_ltdb_fetch(db, key, &header, mem_ctx, &data);
 	if (!NT_STATUS_IS_OK(status) &&
@@ -723,8 +722,7 @@ static NTSTATUS db_ctdb_store_db_seqnum(struct db_ctdb_transaction_handle *h,
 	TDB_DATA key;
 	TDB_DATA data;
 
-	key.dptr = (uint8_t *)discard_const(keyname);
-	key.dsize = strlen(keyname);
+	key = string_term_tdb_data(keyname);
 
 	data.dptr = (uint8_t *)&seqnum;
 	data.dsize = sizeof(uint64_t);


-- 
SAMBA-CTDB repository


More information about the samba-cvs mailing list