dovecot-2.0: dsync: Don't assert-crash if trying to convert mail...

dovecot at dovecot.org dovecot at dovecot.org
Tue Nov 9 23:12:39 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/fa62e1a578a0
changeset: 12409:fa62e1a578a0
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Nov 09 21:12:35 2010 +0000
description:
dsync: Don't assert-crash if trying to convert mailbox whose name is too long.

diffstat:

 src/dsync/dsync-worker-local.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (18 lines):

diff -r 631e0d846e57 -r fa62e1a578a0 src/dsync/dsync-worker-local.c
--- a/src/dsync/dsync-worker-local.c	Tue Nov 09 21:03:34 2010 +0000
+++ b/src/dsync/dsync-worker-local.c	Tue Nov 09 21:12:35 2010 +0000
@@ -1101,6 +1101,14 @@
 			/* probably some reserved name (e.g. dbox-Mails) */
 			name = t_strconcat("_", name, NULL);
 		}
+		if (!mailbox_list_is_valid_create_name(ns->list, name)) {
+			/* name is too long? just give up and generate a
+			   unique name */
+			uint8_t guid[MAIL_GUID_128_SIZE];
+
+			mail_generate_guid_128(guid);
+			name = mail_guid_128_to_string(guid);
+		}
 		i_assert(mailbox_list_is_valid_create_name(ns->list, name));
 	}
 	return name;


More information about the dovecot-cvs mailing list