]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Reinitialize local acl object after creating mailbox
authorAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 5 May 2021 10:40:29 +0000 (13:40 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 10 May 2021 08:37:22 +0000 (08:37 +0000)
For INDEX layout this is needed to actually get the local mailbox path.
This fixes inheriting ACLs from parent folder for INDEX layouts.

src/plugins/acl/acl-mailbox.c

index b682ddcd86d638484f560b7842d838ecf6445aba..877dba85f5c434791b0807ff67d076419ea352df 100644 (file)
@@ -148,6 +148,12 @@ acl_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
        abox->skip_acl_checks = TRUE;
        ret = abox->module_ctx.super.create_box(box, update, directory);
        abox->skip_acl_checks = FALSE;
+       /* update local acl object, otherwise with LAYOUT=INDEX, we end up
+          without local path to acl file, and copying fails. */
+       struct acl_backend *acl_be = abox->aclobj->backend;
+       acl_object_deinit(&abox->aclobj);
+       abox->aclobj = acl_object_init_from_name(acl_be, box->name);
+
        if (ret == 0)
                acl_mailbox_copy_acls_from_parent(box);
        return ret;