summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2009-11-21 00:08:38 +0100
committerMichael Adam <obnox@samba.org>2009-11-21 00:49:28 +0100
commit4afffc96ee7ed81c4d77b28da887fcb51f1b3579 (patch)
treefa3b0ee6760e5a2a3ccdd2ae70e88b6ece966a7b
parentc1cb1f7724bd9c6e1862e59b71fc3f5375d6ff3e (diff)
downloadsamba-4afffc96ee7ed81c4d77b28da887fcb51f1b3579.tar.gz
samba-4afffc96ee7ed81c4d77b28da887fcb51f1b3579.tar.bz2
samba-4afffc96ee7ed81c4d77b28da887fcb51f1b3579.zip
s3:fix endianness bug in dbwrap_change_uint32_atomic() (bug #6901)
Michael
-rw-r--r--source3/lib/dbwrap_util.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c
index 1c190167b5..96888a4fb0 100644
--- a/source3/lib/dbwrap_util.c
+++ b/source3/lib/dbwrap_util.c
@@ -118,7 +118,7 @@ static NTSTATUS dbwrap_change_uint32_atomic_action(struct db_context *db,
{
struct db_record *rec;
uint32 val = -1;
- TDB_DATA data;
+ uint32_t v_store;
NTSTATUS ret;
struct dbwrap_change_uint32_atomic_context *state;
@@ -141,10 +141,12 @@ static NTSTATUS dbwrap_change_uint32_atomic_action(struct db_context *db,
val += state->change_val;
- data.dsize = sizeof(val);
- data.dptr = (uint8 *)&val;
+ SIVAL(&v_store, 0, val);
- ret = rec->store(rec, data, TDB_REPLACE);
+ ret = rec->store(rec,
+ make_tdb_data((const uint8 *)&v_store,
+ sizeof(v_store)),
+ TDB_REPLACE);
done:
TALLOC_FREE(rec);