]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: treat empty root_dir as an empty string
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Mon, 17 Oct 2016 13:13:21 +0000 (09:13 -0400)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 18 Nov 2016 12:19:20 +0000 (14:19 +0200)
src/lib-storage/mail-storage-private.h
src/lib-storage/mail-storage.c

index ee6f49f7749f4fb7a2bd3e817234c07d163eb9d2..e5fc1bea81468df1ed9c146259f8c9b5e1b82438 100644 (file)
@@ -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;
index 2fac3775ccd0c9d1d9c03ce7a1d4b86c168d69a6..c145e281e5118f6bb04a7c632aeff6a852a9711e 100644 (file)
@@ -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) {