]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mbox: Fixed assert-crash with pop3_lock_session=yes
authorTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 19:47:58 +0000 (14:47 -0500)
committerTimo Sirainen <tss@iki.fi>
Thu, 8 Jan 2009 19:47:58 +0000 (14:47 -0500)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-transaction.c

index 815d2656ed48bb6e4dd22be5922f129ea1d1cdd4..c5f0c1c0271626265208d93254f5d1e85cc8d404 100644 (file)
@@ -50,8 +50,12 @@ static int mbox_transaction_commit(struct mail_index_transaction *t,
                if (mbox_unlock(mbox, lock_id) < 0)
                        ret = -1;
        }
-       i_assert(mbox->ibox.box.transaction_count > 0 ||
-                mbox->mbox_lock_type == F_UNLCK);
+       if (mbox->mbox_global_lock_id == 0) {
+               i_assert(mbox->ibox.box.transaction_count > 0 ||
+                        mbox->mbox_lock_type == F_UNLCK);
+       } else {
+               i_assert(mbox->mbox_lock_type == F_WRLCK);
+       }
        return ret;
 }