]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Fixed shared namespace initialization.
authorTimo Sirainen <tss@iki.fi>
Sun, 28 Jun 2009 03:32:31 +0000 (23:32 -0400)
committerTimo Sirainen <tss@iki.fi>
Sun, 28 Jun 2009 03:32:31 +0000 (23:32 -0400)
--HG--
branch : HEAD

src/lib-storage/mail-storage.c

index 460312549e8d2d244c445c677c4e2d0f2f8a5daa..09b5f410b4093c69d91ea0621f147067d7e8e85f 100644 (file)
@@ -168,6 +168,10 @@ mail_storage_create_root(struct mailbox_list *list,
 
        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_namespace *ns, const char *driver,
        }
 
        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,