dovecot-2.2: lib-storage: When mailbox is deleted, reset its cac...

dovecot at dovecot.org dovecot at dovecot.org
Sat Oct 25 03:21:20 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/5e4a7fd9782c
changeset: 18010:5e4a7fd9782c
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Oct 25 06:18:06 2014 +0300
description:
lib-storage: When mailbox is deleted, reset its cached paths.
If mailbox is still later on recreated, the paths may have changed.

diffstat:

 src/lib-storage/mail-storage.c |  11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diffs (28 lines):

diff -r 5c15c7f57253 -r 5e4a7fd9782c src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Sat Oct 25 06:16:47 2014 +0300
+++ b/src/lib-storage/mail-storage.c	Sat Oct 25 06:18:06 2014 +0300
@@ -1329,6 +1329,13 @@
 	return 0;
 }
 
+static void mailbox_close_reset_path(struct mailbox *box)
+{
+	memset(&box->_perm, 0, sizeof(box->_perm));
+	box->_path = NULL;
+	box->_index_path = NULL;
+}
+
 int mailbox_delete(struct mailbox *box)
 {
 	int ret;
@@ -1357,6 +1364,10 @@
 
 	box->deleting = FALSE;
 	mailbox_close(box);
+
+	/* if mailbox is reopened, its path may be different with
+	   LAYOUT=index */
+	mailbox_close_reset_path(box);
 	return ret;
 }
 


More information about the dovecot-cvs mailing list