From c4f76f390c75aac7f41492db4c858576fcab54d3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 26 Jul 2010 19:21:47 +0100 Subject: [PATCH] mbox: Fixed assert-crashing on failures with read-only mboxes --- src/lib-storage/index/mbox/mbox-sync.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } } -- 2.47.3