summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-01-18 17:26:04 +0100
committerMichael Adam <obnox@samba.org>2010-02-12 23:12:12 +0100
commit1933214108d1a71bc6473a696ce35020a427d8f4 (patch)
treee8ff3651da5b600c2e7c36a0254d68de60189b5a /source3/lib
parentc311697aded87ce624d40cbf14e05d6e6377c257 (diff)
downloadsamba-1933214108d1a71bc6473a696ce35020a427d8f4.tar.gz
samba-1933214108d1a71bc6473a696ce35020a427d8f4.tar.bz2
samba-1933214108d1a71bc6473a696ce35020a427d8f4.zip
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
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 79c4c0ce42..ddc886864b 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);