]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: If shared namespace uses %% in location, but not in prefix, fail with...
authorTimo Sirainen <tss@iki.fi>
Thu, 2 Sep 2010 14:53:08 +0000 (15:53 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 2 Sep 2010 14:53:08 +0000 (15:53 +0100)
src/lib-storage/mail-namespace.c

index 2a0005551dbffcfb3096a11277baf6d2a2453c42..0d0a137c7fbe81323be9023f3a051c220b4203ad 100644 (file)
@@ -125,8 +125,12 @@ namespace_add(struct mail_user *user,
        ns->mail_set = mail_set;
        ns->prefix = i_strdup(ns_set->prefix);
 
-       if (ns->type == NAMESPACE_SHARED && strchr(ns->prefix, '%') != NULL) {
-               /* dynamic shared namespace */
+       if (ns->type == NAMESPACE_SHARED &&
+           (strchr(ns->prefix, '%') != NULL ||
+            strchr(ns->set->location, '%') != NULL)) {
+               /* dynamic shared namespace. the above check catches wrong
+                  mixed %% usage, but still allows for specifying a shared
+                  namespace to an explicit location without any %% */
                ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
                driver = "shared";
        } else {