From: Timo Sirainen Date: Mon, 26 Jul 2010 18:21:47 +0000 (+0100) Subject: mbox: Fixed assert-crashing on failures with read-only mboxes X-Git-Tag: 2.0.rc4~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4f76f390c75aac7f41492db4c858576fcab54d3;p=thirdparty%2Fdovecot%2Fcore.git mbox: Fixed assert-crashing on failures with read-only mboxes --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 2c26de9149..88aff6c602 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -1592,8 +1592,9 @@ static int mbox_sync_do(struct mbox_sync_context *sync_ctx, if (sync_ctx->delay_writes && (sync_ctx->errors || sync_ctx->renumber_uids)) { /* fixing a broken mbox state, be sure to write - the changes. */ - sync_ctx->delay_writes = FALSE; + the changes (except if we're readonly). */ + if (!sync_ctx->readonly) + sync_ctx->delay_writes = FALSE; } if (++i == 3) break; @@ -1791,6 +1792,7 @@ again: if (mbox_lock(mbox, F_RDLCK, lock_id) <= 0) return -1; mbox->box.backend_readonly = readonly = TRUE; + delay_writes = TRUE; } }