diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2011-04-18 22:15:11 +0930 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2011-04-18 22:15:11 +0930 |
commit | 6aa72dae8fc341de5b497f831ded1f8f519fa8fb (patch) | |
tree | 481696624b6e2f7e7d618755117579f36438f410 /lib/tdb/common | |
parent | dfb490d551e9213e957ea547cb399c3ed408bdc9 (diff) | |
download | samba-6aa72dae8fc341de5b497f831ded1f8f519fa8fb.tar.gz samba-6aa72dae8fc341de5b497f831ded1f8f519fa8fb.tar.bz2 samba-6aa72dae8fc341de5b497f831ded1f8f519fa8fb.zip |
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>
Diffstat (limited to 'lib/tdb/common')
-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 c49de3877c..4bc8044219 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) { |