dovecot-2.0: Fixed shared namespace initialization.

dovecot at dovecot.org dovecot at dovecot.org
Sun Jun 28 06:32:53 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/ac0a9729fe3c
changeset: 9548:ac0a9729fe3c
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 27 23:32:31 2009 -0400
description:
Fixed shared namespace initialization.

diffstat:

1 file changed, 10 insertions(+), 3 deletions(-)
src/lib-storage/mail-storage.c |   13 ++++++++++---

diffs (30 lines):

diff -r d2b2742dea75 -r ac0a9729fe3c src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Sat Jun 27 22:25:24 2009 -0400
+++ b/src/lib-storage/mail-storage.c	Sat Jun 27 23:32:31 2009 -0400
@@ -168,6 +168,10 @@ mail_storage_create_root(struct mailbox_
 
 	root_dir = mailbox_list_get_path(list, NULL,
 					 MAILBOX_LIST_PATH_TYPE_MAILBOX);
+	if (root_dir == NULL) {
+		/* storage doesn't use directories (e.g. shared root) */
+		return 0;
+	}
 	if (stat(root_dir, &st) == 0) {
 		/* ok */
 		return 0;
@@ -241,9 +245,12 @@ int mail_storage_create(struct mail_name
 	}
 
 	memset(&list_set, 0, sizeof(list_set));
-	if (data == NULL)
-		data = "";
-	else {
+	if (data == NULL) {
+		/* autodetect */
+	} else if (driver != NULL && strcmp(driver, "shared") == 0) {
+		/* internal shared namespace */
+		list_set.root_dir = ns->user->set->base_dir;
+	} else {
 		if (driver == NULL)
 			mail_storage_set_autodetection(&data, &driver);
 		if (mailbox_list_settings_parse(data, &list_set, ns,


More information about the dovecot-cvs mailing list