git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a23ff8b
)
s3:fix endianness bug in dbwrap_change_uint32_atomic() (bug #6901)
author
Michael Adam
<obnox@samba.org>
Fri, 20 Nov 2009 23:21:56 +0000
(
00:21
+0100)
committer
Karolin Seeger
<kseeger@samba.org>
Mon, 23 Nov 2009 07:59:39 +0000
(08:59 +0100)
Michael
source3/lib/dbwrap_util.c
patch
|
blob
|
history
diff --git
a/source3/lib/dbwrap_util.c
b/source3/lib/dbwrap_util.c
index 3be3a49e7defc623305e088d8fa0b086431b79fc..59092f5164365987a424569ee11d4b24ffe9d60a 100644
(file)
--- a/
source3/lib/dbwrap_util.c
+++ b/
source3/lib/dbwrap_util.c
@@
-110,7
+110,7
@@
uint32_t dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr,
{
struct db_record *rec;
uint32 val = -1;
-
TDB_DATA data
;
+
uint32_t v_store
;
if (!(rec = db->fetch_locked(db, NULL,
string_term_tdb_data(keystr)))) {
@@
-128,10
+128,11
@@
uint32_t dbwrap_change_uint32_atomic(struct db_context *db, const char *keystr,
val += change_val;
- data.dsize = sizeof(val);
- data.dptr = (uint8 *)&val;
+ SIVAL(&v_store, 0, val);
- rec->store(rec, data, TDB_REPLACE);
+ rec->store(rec,
+ make_tdb_data((const uint8_t *)&v_store, sizeof(v_store)),
+ TDB_REPLACE);
TALLOC_FREE(rec);