From: Aki Tuomi Date: Wed, 5 May 2021 10:40:29 +0000 (+0300) Subject: acl: Reinitialize local acl object after creating mailbox X-Git-Tag: 2.3.16~171 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=954766258622977b5cef20d19a3825e2baacec2f;p=thirdparty%2Fdovecot%2Fcore.git acl: Reinitialize local acl object after creating mailbox For INDEX layout this is needed to actually get the local mailbox path. This fixes inheriting ACLs from parent folder for INDEX layouts. --- diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index b682ddcd86..877dba85f5 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -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;