changeset 12157:4a753371ae73

dsync: Avoid assert-crashing when trying to create a reserved mailbox name (e.g. dbox-Mails)
author Timo Sirainen <tss@iki.fi>
date Thu, 23 Sep 2010 16:40:42 +0100
parents c24206d083e8
children 77e71551fe55
files src/dsync/dsync-worker-local.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/dsync/dsync-worker-local.c	Thu Sep 23 16:36:00 2010 +0100
+++ b/src/dsync/dsync-worker-local.c	Thu Sep 23 16:40:42 2010 +0100
@@ -1097,6 +1097,11 @@
 			name = mailbox_name_force_cleanup(name,
 							  worker->alt_char);
 		}
+		if (!mailbox_list_is_valid_create_name(ns->list, name)) {
+			/* probably some reserved name (e.g. dbox-Mails) */
+			name = t_strconcat("_", name, NULL);
+		}
+		i_assert(mailbox_list_is_valid_create_name(ns->list, name));
 	}
 	return name;
 }