Fix corruption when rewriting older (smaller) index records

Resolves: RHEL-136233
This commit is contained in:
Martin Osvald 2026-01-17 17:06:50 +01:00
parent b5fd7df72a
commit b78ea9292f
3 changed files with 27 additions and 2 deletions

View File

@ -0,0 +1,19 @@
commit c665af571dc1f9d870d53f2aa4ea29bb5cd52738
Author: Bron Gondwana <brong@fastmailteam.com>
Date: Mon Jul 2 17:28:21 2018 +1000
commit_one: only rewrite the actual record size!
diff --git a/imap/mailbox.c b/imap/mailbox.c
index da57f0ccb..84f1815b8 100644
--- a/imap/mailbox.c
+++ b/imap/mailbox.c
@@ -1798,7 +1798,7 @@ static int _commit_one(struct mailbox *mailbox, struct index_change *change)
return IMAP_IOERROR;
}
- if (retry_write(mailbox->index_fd, buf, INDEX_RECORD_SIZE) != INDEX_RECORD_SIZE) {
+ if (retry_write(mailbox->index_fd, buf, mailbox->i.record_size) != mailbox->i.record_size) {
syslog(LOG_ERR, "IOERROR: writing index record %u for %s: %m",
recno, mailbox->name);
return IMAP_IOERROR;

View File

@ -9,7 +9,7 @@
Name: cyrus-imapd
Version: 3.0.7
Release: 27%{?dist}
Release: 28%{?dist}
%define ssl_pem_file_prefix /etc/pki/%name/%name
@ -55,7 +55,9 @@ Patch14: cyrus-imapd-load-tombstones-for-cleanup.patch
# https://github.com/cyrusimap/cyrus-imapd/commit/ed1a17b09e2e03788852e122f213b88352bc24b9
Patch15: cyrus-imapd-ptclient-canonification_across_multiple_domains.patch
# https://github.com/cyrusimap/cyrus-imapd/commit/1152ce70af232fc4200bbeca18961f99e12d73df
Patch16: patch-cyrus-ldap-group-retriaval
Patch16: cyrus-imapd-ldap-group-retriaval.patch
# https://github.com/cyrusimap/cyrus-imapd/commit/c665af571dc1f9d870d53f2aa4ea29bb5cd52738
Patch17: cyrus-imapd-fix-index-records-corruption.patch
Source10: cyrus-imapd.logrotate
Source11: cyrus-imapd.pam-config
@ -693,6 +695,10 @@ getent passwd cyrus >/dev/null || /usr/sbin/useradd -c "Cyrus IMAP Server" -d /v
%changelog
* Sat Jan 17 2026 Martin Osvald <mosvald@redhat.com> - 3.0.7-28
- Fix corruption when rewriting older (smaller) index records
Resolves: RHEL-136233
* Tue Oct 29 2024 Martin Osvald <mosvald@redhat.com> - 3.0.7-27
- Fix regression while retrieving ldap group names
- Resolves: RHEL-61691