dovecot-1.2: Shared namespace: If we don't have a directory, ret...

dovecot at dovecot.org dovecot at dovecot.org
Mon Sep 22 22:31:40 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/fd4091d53627
changeset: 8211:fd4091d53627
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Sep 22 22:31:13 2008 +0300
description:
Shared namespace: If we don't have a directory, return NULL instead of panicing.
The callers are now expected to handle returned NULLs. In future some other
non-filesystem based storages will probably also return NULLs.

diffstat:

1 file changed, 3 insertions(+), 3 deletions(-)
src/lib-storage/index/shared/shared-list.c |    6 +++---

diffs (23 lines):

diff -r 1ea7d60cf39a -r fd4091d53627 src/lib-storage/index/shared/shared-list.c
--- a/src/lib-storage/index/shared/shared-list.c	Mon Sep 22 22:25:25 2008 +0300
+++ b/src/lib-storage/index/shared/shared-list.c	Mon Sep 22 22:31:13 2008 +0300
@@ -73,7 +73,7 @@ shared_list_get_path(struct mailbox_list
 {
 	struct mail_namespace *ns;
 
-	if (list->ns->storage == NULL ||
+	if (list->ns->storage == NULL || name == NULL ||
 	    shared_storage_get_namespace(list->ns->storage, &name, &ns) < 0) {
 		switch (type) {
 		case MAILBOX_LIST_PATH_TYPE_DIR:
@@ -84,8 +84,8 @@ shared_list_get_path(struct mailbox_list
 			/* we can safely say we don't use indexes */
 			return "";
 		}
-		i_panic("shared mailbox list: Can't return path for '%s'",
-			list->ns->prefix);
+		/* we don't have a directory we can use. */
+		return NULL;
 	}
 	return mailbox_list_get_path(ns->list, name, type);
 }


More information about the dovecot-cvs mailing list