summaryrefslogtreecommitdiff
path: root/lib/ntdb/transaction.c
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2012-06-18 22:30:29 +0930
committerRusty Russell <rusty@rustcorp.com.au>2012-06-19 05:38:06 +0200
commitdd4eed47591eeb6aafe5782690c1b550d0e3ebc4 (patch)
treeb0c9f5a94746d18f2c45a4c34115d77baac8cc6f /lib/ntdb/transaction.c
parent40cf08823dadb7f2f9cb3b32c2e64b6242522ef4 (diff)
downloadsamba-dd4eed47591eeb6aafe5782690c1b550d0e3ebc4.tar.gz
samba-dd4eed47591eeb6aafe5782690c1b550d0e3ebc4.tar.bz2
samba-dd4eed47591eeb6aafe5782690c1b550d0e3ebc4.zip
ntdb: fix recovery data write.
We were missing the last few bytes. Found by 100 runs of ntdbtorture -t -k. The transaction test code didn't catch this, because usually those last few bytes are irrelevant to the actual contents of the database. We fix the test. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'lib/ntdb/transaction.c')
-rw-r--r--lib/ntdb/transaction.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/ntdb/transaction.c b/lib/ntdb/transaction.c
index 9f953a50e3..05f571e51a 100644
--- a/lib/ntdb/transaction.c
+++ b/lib/ntdb/transaction.c
@@ -927,7 +927,8 @@ static enum NTDB_ERROR transaction_setup_recovery(struct ntdb_context *ntdb)
ntdb_convert(ntdb, recovery, sizeof(*recovery));
/* write the recovery data to the recovery area */
- ecode = methods->twrite(ntdb, recovery_off, recovery, recovery_size);
+ ecode = methods->twrite(ntdb, recovery_off, recovery,
+ sizeof(*recovery) + recovery_size);
if (ecode != NTDB_SUCCESS) {
free(recovery);
return ntdb_logerr(ntdb, ecode, NTDB_LOG_ERROR,