diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-04-18 22:15:11 +0930 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2011-04-26 20:08:36 +0200 |
commit | beacde8a0ce6b6f4f91f8be4aa604694b2e1ff7e (patch) | |
tree | fb06b6f1dc8ecf5aa0ca33890202dec24c2b2f4e | |
parent | f09bc1f520cebc37a163b306371c5beb850c8f31 (diff) | |
download | samba-beacde8a0ce6b6f4f91f8be4aa604694b2e1ff7e.tar.gz |
tdb: fix transaction recovery area for converted tdbs.
This is why macros are dangerous; these were converting the pointers, not the
things pointed to!
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
(cherry picked from commit 6aa72dae8fc341de5b497f831ded1f8f519fa8fb)
(cherry picked from commit 59cccbf09e53b457bc400edd371e092ed8259acb)
-rw-r--r-- | lib/tdb/common/transaction.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c index c49de3877cc..4bc8044219f 100644 --- a/lib/tdb/common/transaction.c +++ b/lib/tdb/common/transaction.c @@ -786,7 +786,7 @@ static int transaction_setup_recovery(struct tdb_context *tdb, rec->data_len = recovery_size; rec->rec_len = recovery_max_size; rec->key_len = old_map_size; - CONVERT(rec); + CONVERT(*rec); /* build the recovery data into a single blob to allow us to do a single large write, which should be more efficient */ @@ -833,7 +833,9 @@ static int transaction_setup_recovery(struct tdb_context *tdb, /* and the tailer */ tailer = sizeof(*rec) + recovery_max_size; memcpy(p, &tailer, 4); - CONVERT(p); + if (DOCONV()) { + tdb_convert(p, 4); + } /* write the recovery data to the recovery area */ if (methods->tdb_write(tdb, recovery_offset, data, sizeof(*rec) + recovery_size) == -1) { |