]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Give an error about duplicate namespace prefixes.
authorTimo Sirainen <tss@iki.fi>
Thu, 2 Sep 2010 16:04:15 +0000 (17:04 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 2 Sep 2010 16:04:15 +0000 (17:04 +0100)
src/lib-storage/mail-namespace.c

index 0d0a137c7fbe81323be9023f3a051c220b4203ad..15554345c438870f55ab1aaacfaf2f345cdc9f42 100644 (file)
@@ -206,6 +206,13 @@ namespaces_check(struct mail_namespace *namespaces, const char **error_r)
        char list_sep = '\0';
 
        for (ns = namespaces; ns != NULL; ns = ns->next) {
+               if (mail_namespace_find_prefix(ns->next, ns->prefix) != NULL) {
+                       *error_r = t_strdup_printf(
+                               "namespace configuration error: "
+                               "Duplicate namespace prefix: \"%s\"",
+                               ns->prefix);
+                       return FALSE;
+               }
                if (namespace_set_alias_for(ns, namespaces, error_r) < 0)
                        return FALSE;
                if ((ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0) {