From: Timo Sirainen Date: Sat, 17 Feb 2018 20:10:17 +0000 (+0200) Subject: lib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_acces... X-Git-Tag: 2.3.9~2237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20856c63a2c0f694f32db4368cea2505937570cb;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_access=yes It was already allowed with LAYOUT=fs, but not with e.g. LAYOUT=Maildir++. Now it's possible to use e.g. SELECT /home/shareduser/Maildir/test.box --- diff --git a/src/lib-storage/mailbox-list.c b/src/lib-storage/mailbox-list.c index 45086f8a74..5ca7c77d1b 100644 --- a/src/lib-storage/mailbox-list.c +++ b/src/lib-storage/mailbox-list.c @@ -1290,6 +1290,15 @@ mailbox_list_is_valid_fs_name(struct mailbox_list *list, const char *name, if (list->mail_set->mail_full_filesystem_access) return TRUE; + /* 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; + } + /* make sure it's not absolute path */ if (*name == '/') { *error_r = "Begins with '/'"; @@ -1365,15 +1374,6 @@ bool mailbox_list_is_valid_name(struct mailbox_list *list, 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); }