dovecot-2.2: mbox: Fixed accessing v1.x mbox index files without...
dovecot at dovecot.org
dovecot at dovecot.org
Sun May 20 03:26:27 EEST 2012
details: http://hg.dovecot.org/dovecot-2.2/rev/1289b79241bb
changeset: 14321:1289b79241bb
user: Timo Sirainen <tss at iki.fi>
date: Sat Mar 10 18:32:34 2012 +0200
description:
mbox: Fixed accessing v1.x mbox index files without errors.
diffstat:
src/lib-storage/index/mbox/mbox-sync.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diffs (17 lines):
diff -r 96ad6da5c902 -r 1289b79241bb src/lib-storage/index/mbox/mbox-sync.c
--- a/src/lib-storage/index/mbox/mbox-sync.c Sat Mar 10 15:53:39 2012 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c Sat Mar 10 18:32:34 2012 +0200
@@ -1394,6 +1394,13 @@
&data, &data_size);
if (data_size != sizeof(mbox->mbox_hdr) ||
memcmp(data, &mbox->mbox_hdr, data_size) != 0) {
+ if (data_size != sizeof(mbox->mbox_hdr)) {
+ /* upgrading from v1.x */
+ mail_index_ext_resize(trans, mbox->mbox_ext_idx,
+ sizeof(mbox->mbox_hdr),
+ sizeof(uint64_t),
+ sizeof(uint64_t));
+ }
mail_index_update_header_ext(trans, mbox->mbox_ext_idx,
0, &mbox->mbox_hdr,
sizeof(mbox->mbox_hdr));
More information about the dovecot-cvs
mailing list