diff src/lib-storage/index/shared/shared-storage.c @ 8927:7d484e0f0789 HEAD

Shared mailboxes: Find the final storage before calling mail_storage.mailbox_open(), not inside it. This fixes some crashes with plugins.
author Timo Sirainen <tss@iki.fi>
date Tue, 07 Apr 2009 17:54:32 -0400
parents 676efa08f5d7
children 3a30d73fc463
line wrap: on
line diff
--- a/src/lib-storage/index/shared/shared-storage.c	Tue Apr 07 16:38:47 2009 -0400
+++ b/src/lib-storage/index/shared/shared-storage.c	Tue Apr 07 17:54:32 2009 -0400
@@ -274,33 +274,6 @@
 	mail_storage_set_error(shared_storage, error, str);
 }
 
-static struct mailbox *
-shared_mailbox_open(struct mail_storage *storage, const char *name,
-		    struct istream *input, enum mailbox_open_flags flags)
-{
-	struct mail_namespace *ns;
-	struct mailbox *box;
-
-	if (input != NULL) {
-		mail_storage_set_critical(storage,
-			"Shared storage doesn't support streamed mailboxes");
-		return NULL;
-	}
-
-	if (shared_storage_get_namespace(storage, &name, &ns) < 0)
-		return NULL;
-
-	/* if we call the normal mailbox_open() here the plugins will see
-	   mailbox_open() called twice and they could break. */
-	box = ns->storage->storage_class->v.
-		mailbox_open(ns->storage, name, NULL, flags);
-	if (box == NULL)
-		shared_mailbox_copy_error(storage, ns);
-	else
-		ns->flags |= NAMESPACE_FLAG_USABLE;
-	return box;
-}
-
 static int shared_mailbox_create(struct mail_storage *storage,
 				 const char *name, bool directory)
 {
@@ -327,7 +300,7 @@
 		shared_create,
 		index_storage_destroy,
 		NULL,
-		shared_mailbox_open,
+		NULL,
 		shared_mailbox_create
 	}
 };