dovecot-2.2: lib-storage: Don't allow '/' for filesystem based m...

dovecot at dovecot.org dovecot at dovecot.org
Mon Jul 28 12:16:49 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/4b8a098a70b7
changeset: 17633:4b8a098a70b7
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Jul 28 15:14:17 2014 +0300
description:
lib-storage: Don't allow '/' for filesystem based mailbox list backends if their internal separator isn't '/'.
Basically this means that Maildir++ shouldn't be allowed to create mailboxes
with '/' in the name.

diffstat:

 src/lib-storage/mailbox-list.c |  9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diffs (19 lines):

diff -r 2d2d75ac6715 -r 4b8a098a70b7 src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Fri Jul 25 14:10:04 2014 +0300
+++ b/src/lib-storage/mailbox-list.c	Mon Jul 28 15:14:17 2014 +0300
@@ -1251,6 +1251,15 @@
 		return FALSE;
 	}
 
+	/* either the list backend uses '/' as the hierarchy separator or
+	   it doesn't use filesystem at all (PROP_NO_ROOT) */
+	if ((list->props & MAILBOX_LIST_PROP_NO_ROOT) == 0 &&
+	    mailbox_list_get_hierarchy_sep(list) != '/' &&
+	    strchr(name, '/') != NULL) {
+		*error_r = "Name must not have '/' characters";
+		return FALSE;
+	}
+
 	return mailbox_list_is_valid_fs_name(list, name, error_r);
 }
 


More information about the dovecot-cvs mailing list