dovecot-2.2: lib-storage: Maildir++ layout shouldn't disallow "c...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jan 10 11:52:38 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/577c6dd315c3
changeset: 15631:577c6dd315c3
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jan 10 11:52:27 2013 +0200
description:
lib-storage: Maildir++ layout shouldn't disallow "cur", "new" or "tmp" mailbox names.

diffstat:

 src/lib-storage/mailbox-list.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 7035da8cfaf4 -r 577c6dd315c3 src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Thu Jan 10 10:23:44 2013 +0200
+++ b/src/lib-storage/mailbox-list.c	Thu Jan 10 11:52:27 2013 +0200
@@ -1127,9 +1127,15 @@
 
 	/* make sure the mailbox name doesn't contain any foolishness:
 	   "../" could give access outside the mailbox directory.
-	   "./" and "//" could fool ACL checks. */
+	   "./" and "//" could fool ACL checks.
+
+	   some mailbox formats have reserved directory names, such as
+	   Maildir's cur/new/tmp. if any of those would conflict with the
+	   mailbox directory name, it's not valid. maildir++ is kludged here as
+	   a special case because all of its mailbox dirs begin with "." */
 	allow_internal_dirs = list->v.is_internal_name == NULL ||
-		*list->set.maildir_name != '\0';
+		*list->set.maildir_name != '\0' ||
+		strcmp(list->name, MAILBOX_LIST_NAME_MAILDIRPLUSPLUS) == 0;
 	T_BEGIN {
 		const char *const *names;
 


More information about the dovecot-cvs mailing list