]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Fix ACL in parent mailbox potentially hiding its children.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 30 May 2017 06:18:14 +0000 (09:18 +0300)
committerGitLab <gitlab@git.dovecot.net>
Tue, 30 May 2017 07:00:34 +0000 (10:00 +0300)
fs_get_existence_info_flag() was only being called with LAYOUT=fs and
Maildir combination, so only it was broken if the parent mailbox wasn't
visible but its children were.

src/lib-storage/list/mailbox-list-fs-iter.c

index ccf97f8026c3d5ec5a18c21404a638d3c3fc72ba..646fc82c89c8c1afb6c4e096dbe51c63ab66ea07 100644 (file)
@@ -75,8 +75,12 @@ fs_get_existence_info_flag(struct fs_list_iterate_context *ctx,
        }
        switch (existence) {
        case MAILBOX_EXISTENCE_NONE:
-               *info_flags |= MAILBOX_NONEXISTENT;
-               break;
+               /* We already found out that this mailbox exists. So this is
+                  either a race condition or ACL plugin prevented access to
+                  this. In any case treat this as a \NoSelect mailbox so that
+                  we'll recurse into its potential children. This is
+                  especially important if ACL disabled access to the parent
+                  mailbox, but child mailboxes would be accessible. */
        case MAILBOX_EXISTENCE_NOSELECT:
                *info_flags |= MAILBOX_NOSELECT;
                break;