]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Allow ignoring index corruption checks with --enable-devel-checks
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 24 Sep 2021 15:21:29 +0000 (18:21 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 29 Sep 2021 07:28:30 +0000 (07:28 +0000)
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.

src/lib-index/mail-index-sync-update.c

index 2037a36a2473993b1fef9a4456a0e7cdb19ee618..0c3799564339cc8df8df75369dfa278719d81882 100644 (file)
@@ -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;