From: Markus Valentin Date: Tue, 1 Jun 2021 11:10:23 +0000 (+0200) Subject: acl: If acl_ignore_namespace is set acl_backend can be NULL X-Git-Tag: 2.3.15~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=84c6770d4370ec80c47fa144a1f9b36425b1cd41;p=thirdparty%2Fdovecot%2Fcore.git acl: If acl_ignore_namespace is set acl_backend can be NULL Allow an uninitialized acl backend when ignore_acls is set. --- diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index 57ff423483..7cc8775990 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -84,7 +84,8 @@ static void acl_mailbox_free(struct mailbox *box) { struct acl_mailbox *abox = ACL_CONTEXT_REQUIRE(box); - acl_object_deinit(&abox->aclobj); + if (abox->aclobj != NULL) + acl_object_deinit(&abox->aclobj); abox->module_ctx.super.free(box); } @@ -622,8 +623,11 @@ void acl_mailbox_allocated(struct mailbox *box) box->vlast = &abox->module_ctx.super; /* aclobj can be used for setting ACLs, even when mailbox is opened with IGNORE_ACLS flag */ - abox->aclobj = acl_object_init_from_name(alist->rights.backend, + if (alist->rights.backend != NULL) + abox->aclobj = acl_object_init_from_name(alist->rights.backend, mailbox_get_name(box)); + else + i_assert(ignore_acls); v->free = acl_mailbox_free; if (!ignore_acls) {