From: Timo Sirainen Date: Tue, 14 Oct 2025 09:49:54 +0000 (+0300) Subject: maildir: Fix error handling if dovecot-uidlist file is unexpectedly lost X-Git-Tag: 2.4.2~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9caf63a07d73539e5479b821763a96547723b370;p=thirdparty%2Fdovecot%2Fcore.git maildir: Fix error handling if dovecot-uidlist file is unexpectedly lost It would have failed with lseek() error. --- diff --git a/src/lib-storage/index/maildir/maildir-uidlist.c b/src/lib-storage/index/maildir/maildir-uidlist.c index 21de7c7d30..e9602f1f37 100644 --- a/src/lib-storage/index/maildir/maildir-uidlist.c +++ b/src/lib-storage/index/maildir/maildir-uidlist.c @@ -1539,7 +1539,7 @@ static int maildir_uidlist_sync_update(struct maildir_uidlist_sync_ctx *ctx) i_assert(uidlist->initial_hdr_read); if (maildir_uidlist_open_latest(uidlist) < 0) return -1; - if (uidlist->recreate_on_change) + if (uidlist->fd == -1 || uidlist->recreate_on_change) return maildir_uidlist_recreate(uidlist); } i_assert(ctx->first_unwritten_pos != UINT_MAX);