dovecot-2.2: pop3c: Give GUID to the INBOX to avoid crashes with...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jun 12 16:20:30 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/7a7d4d8123d5
changeset: 16492:7a7d4d8123d5
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jun 12 16:20:19 2013 +0300
description:
pop3c: Give GUID to the INBOX to avoid crashes with dsync.

diffstat:

 src/lib-storage/index/pop3c/pop3c-storage.c |  19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diffs (36 lines):

diff -r d212cfb92ce9 -r 7a7d4d8123d5 src/lib-storage/index/pop3c/pop3c-storage.c
--- a/src/lib-storage/index/pop3c/pop3c-storage.c	Wed Jun 12 04:44:11 2013 +0300
+++ b/src/lib-storage/index/pop3c/pop3c-storage.c	Wed Jun 12 16:20:19 2013 +0300
@@ -209,6 +209,23 @@
 	return -1;
 }
 
+static int pop3c_mailbox_get_metadata(struct mailbox *box,
+				      enum mailbox_metadata_items items,
+				      struct mailbox_metadata *metadata_r)
+{
+	if ((items & MAILBOX_METADATA_GUID) != 0) {
+		/* a bit ugly way to do this, but better than nothing for now.
+		   FIXME: if indexes are enabled, keep this there. */
+		mail_generate_guid_128_hash(box->name, metadata_r->guid);
+		items &= ~MAILBOX_METADATA_GUID;
+	}
+	if (items != 0) {
+		if (index_mailbox_get_metadata(box, items, metadata_r) < 0)
+			return -1;
+	}
+	return 0;
+}
+
 static void pop3c_notify_changes(struct mailbox *box ATTR_UNUSED)
 {
 }
@@ -251,7 +268,7 @@
 		index_storage_mailbox_delete,
 		index_storage_mailbox_rename,
 		index_storage_get_status,
-		index_mailbox_get_metadata,
+		pop3c_mailbox_get_metadata,
 		index_storage_set_subscribed,
 		index_storage_attribute_set,
 		index_storage_attribute_get,


More information about the dovecot-cvs mailing list