summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-01-18 17:26:04 +0100
committerKarolin Seeger <kseeger@samba.org>2010-04-01 09:39:16 +0200
commit02a422096e8829d31d99570e9614caf1e133087c (patch)
treeb5954e6dfbf0e00b157cf3b04b42fce3add58c35 /source3/lib
parent777a4d7e7818155c13ed733a94472e8a6bc369b9 (diff)
downloadsamba-02a422096e8829d31d99570e9614caf1e133087c.tar.gz
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 (cherry picked from commit 1933214108d1a71bc6473a696ce35020a427d8f4) (cherry picked from commit c17daced42b3ea78fa8e6f6afc8c2550cac53ca0)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/dbwrap_ctdb.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/source3/lib/dbwrap_ctdb.c b/source3/lib/dbwrap_ctdb.c
index 79c4c0ce420..ddc886864be 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);