From: Timo Sirainen Date: Wed, 27 Dec 2023 18:18:18 +0000 (-0500) Subject: lib-storage: shared - Remove check to see if shared namespace's storage exists X-Git-Tag: 2.4.1~1208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=87eb1dcc399f41fd0f76e51c6fd364cf1360235b;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: shared - Remove check to see if shared namespace's storage exists This doesn't work with imapc when local index files are used, because mailbox_list_get_root_path() returns the index file location then. Just because it doesn't exist yet doesn't mean that the namespace is unusable. There is already a check to verify whether the user exists, which should be enough. --- diff --git a/src/lib-storage/index/shared/shared-storage.c b/src/lib-storage/index/shared/shared-storage.c index 2178dee626..ae6876db7e 100644 --- a/src/lib-storage/index/shared/shared-storage.c +++ b/src/lib-storage/index/shared/shared-storage.c @@ -113,19 +113,6 @@ get_nonexistent_user_path(struct shared_storage *storage, username); } -static bool shared_namespace_exists(struct mail_namespace *ns) -{ - const char *path; - struct stat st; - - if (!mailbox_list_get_root_path(ns->list, MAILBOX_LIST_PATH_TYPE_DIR, - &path)) { - /* we can't know if this exists */ - return TRUE; - } - return stat(path, &st) == 0; -} - static int shared_mail_user_init(struct mail_storage *_storage, struct mail_user *user, struct mail_user *owner, @@ -445,11 +432,6 @@ shared_mail_user_init(struct mail_storage *_storage, event_unref(&set_event); return -1; } - if ((new_ns->flags & NAMESPACE_FLAG_UNUSABLE) == 0 && - !shared_namespace_exists(new_ns)) { - /* this user doesn't have a usable storage */ - new_ns->flags |= NAMESPACE_FLAG_UNUSABLE; - } /* mark the shared namespace root as usable, since it now has child namespaces */ ns->flags |= NAMESPACE_FLAG_USABLE;