]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: If shared namespace prefix doesn't end with hierarchy separator, fail.
authorTimo Sirainen <tss@iki.fi>
Fri, 16 Sep 2011 10:14:11 +0000 (13:14 +0300)
committerTimo Sirainen <tss@iki.fi>
Fri, 16 Sep 2011 10:14:11 +0000 (13:14 +0300)
src/lib-storage/index/shared/shared-storage.c

index 51b38dcc30cb3fff6fe461355b97ad8acf7007d4..b9e048659e33a8adbb9f1eb59fc10f3de4bdc39f 100644 (file)
@@ -79,6 +79,12 @@ shared_storage_create(struct mail_storage *_storage, struct mail_namespace *ns,
                *error_r = "Shared namespace prefix doesn't contain %u or %n";
                return -1;
        }
+       if (p[-1] != ns->sep &&
+           (ns->flags & (NAMESPACE_FLAG_LIST_PREFIX |
+                         NAMESPACE_FLAG_LIST_CHILDREN)) != 0) {
+               *error_r = "Shared namespace prefix doesn't end with hierarchy separator";
+               return -1;
+       }
 
        /* truncate prefix after the above checks are done, so they can log
           the full prefix in error conditions */