From: Josef 'Jeff' Sipek Date: Mon, 17 Oct 2016 13:13:21 +0000 (-0400) Subject: lib-storage: treat empty root_dir as an empty string X-Git-Tag: 2.2.27~105 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=588a47cd86f0bed43f0a6253217ee031ce372eb0;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: treat empty root_dir as an empty string --- diff --git a/src/lib-storage/mail-storage-private.h b/src/lib-storage/mail-storage-private.h index ee6f49f774..e5fc1bea81 100644 --- a/src/lib-storage/mail-storage-private.h +++ b/src/lib-storage/mail-storage-private.h @@ -117,6 +117,8 @@ struct mail_storage { int obj_refcount; /* Linked list of all mailboxes in the storage */ struct mailbox *mailboxes; + /* A "root dir" to enable storage sharing. It is only ever used for + * uniqueness checking (via strcmp) and never used as a path. */ const char *unique_root_dir; char *error_string; diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 2fac3775cc..c145e281e5 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -282,7 +282,7 @@ mail_storage_match_class(struct mail_storage *storage, return FALSE; if ((storage->class_flags & MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT) != 0 && - strcmp(storage->unique_root_dir, set->root_dir) != 0) + strcmp(storage->unique_root_dir, set->root_dir ? set->root_dir : "") != 0) return FALSE; if (strcmp(storage->name, "shared") == 0) {