]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fs layout: Don't assert-crash if namespace prefix begins with the separator.
authorTimo Sirainen <tss@iki.fi>
Wed, 13 Feb 2013 10:43:34 +0000 (12:43 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 13 Feb 2013 10:43:34 +0000 (12:43 +0200)
src/lib-storage/list/mailbox-list-fs-iter.c

index 5063f071b7d69a2744107eff68edf1ec02850fd8..82581583dd9d554be66298e87136d9e0a55a558c 100644 (file)
@@ -399,9 +399,12 @@ static void fs_list_get_roots(struct fs_list_iterate_context *ctx)
                        prefix_vname = t_strdup_until(pattern, last);
                }
 
-               if (p == last+1 && *pattern == ns_sep)
+               if (*pattern == ns_sep && full_fs_access) {
+                       /* pattern=/something with full filesystem access.
+                          (without full filesystem access we want to skip this
+                          if namespace prefix begins with separator) */
                        root = "/";
-               else if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
+               else if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
                         ns->prefix_len == 6 &&
                         strcasecmp(prefix_vname, "INBOX") == 0 &&
                         strncasecmp(ns->prefix, pattern, ns->prefix_len) == 0) {