]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Don't allow syncing to begin if index is marked corrupted.
authorTimo Sirainen <tss@iki.fi>
Wed, 7 Sep 2011 08:30:05 +0000 (11:30 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 7 Sep 2011 08:30:05 +0000 (11:30 +0300)
src/lib-index/mail-index-sync.c

index 03d17f4afbadf47fdbef9f3aec75994bbcd496c8..bcb28804966ded8f55c77594cf185d9dffbc8991 100644 (file)
@@ -434,6 +434,12 @@ int mail_index_sync_begin_to(struct mail_index *index,
 
        i_assert(!index->syncing);
 
+       if (index->map != NULL &&
+           (index->map->hdr.flags & MAIL_INDEX_HDR_FLAG_CORRUPTED) != 0) {
+               /* index is corrupted and need to be reopened */
+               return -1;
+       }
+
        if (log_file_seq != (uint32_t)-1)
                flags |= MAIL_INDEX_SYNC_FLAG_REQUIRE_CHANGES;