]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Storage rebuild panics now earlier if its namespace unexpectedly isn't found.
authorTimo Sirainen <tss@iki.fi>
Fri, 19 Mar 2010 13:34:39 +0000 (15:34 +0200)
committerTimo Sirainen <tss@iki.fi>
Fri, 19 Mar 2010 13:34:39 +0000 (15:34 +0200)
--HG--
branch : HEAD

src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c

index 75c7b7d8f496da3c5d1374e93e0defe4a3305e0f..8b76b194912436c39bf756d081abab13e883d21c 100644 (file)
@@ -522,16 +522,17 @@ rebuild_namespace_mailboxes(struct mdbox_storage_rebuild_context *ctx,
 
 static int rebuild_mailboxes(struct mdbox_storage_rebuild_context *ctx)
 {
-       struct mail_user *user = ctx->storage->storage.storage.user;
+       struct mail_storage *storage = &ctx->storage->storage.storage;
        struct mail_namespace *ns;
 
-       for (ns = user->namespaces; ns != NULL; ns = ns->next) {
-               if (ns->storage == &ctx->storage->storage.storage &&
-                   ns->alias_for == NULL) {
+       for (ns = storage->user->namespaces; ns != NULL; ns = ns->next) {
+               if (ns->storage == storage && ns->alias_for == NULL) {
                        if (rebuild_namespace_mailboxes(ctx, ns) < 0)
                                return -1;
                }
        }
+       if (ctx->default_list == NULL)
+               i_panic("No namespace found for storage=%s", storage->name);
        return 0;
 }