From: Timo Sirainen Date: Fri, 24 Sep 2021 15:21:29 +0000 (+0300) Subject: lib-index: Allow ignoring index corruption checks with --enable-devel-checks X-Git-Tag: 2.3.18~382 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a12796fd66462363194ca915f89c58c85d2aca7b;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Allow ignoring index corruption checks with --enable-devel-checks If DEBUG_IGNORE_INDEX_CORRUPTION environment is set, don't check if index contains internal corruption. This is useful for CI tests that intentionally test corrupted indexes. --- diff --git a/src/lib-index/mail-index-sync-update.c b/src/lib-index/mail-index-sync-update.c index 2037a36a24..0c37995643 100644 --- a/src/lib-index/mail-index-sync-update.c +++ b/src/lib-index/mail-index-sync-update.c @@ -874,6 +874,9 @@ void mail_index_map_check(struct mail_index_map *map) unsigned int del = 0, seen = 0; uint32_t seq, prev_uid = 0; + if (getenv("DEBUG_IGNORE_INDEX_CORRUPTION") != NULL) + return; + i_assert(hdr->messages_count <= map->rec_map->records_count); for (seq = 1; seq <= hdr->messages_count; seq++) { const struct mail_index_record *rec;