]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins/acl: doveadm acl - Fix crash if ACLs not enabled
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Sep 2025 07:51:51 +0000 (10:51 +0300)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 11 Sep 2025 07:51:51 +0000 (10:51 +0300)
Ensure ACLs are actually enabled when opening mailbox.
Fixes Panic: Module context acl_storage_module missing

src/plugins/acl/doveadm-acl.c

index a99aad722a978af299850caaecf7af75197bea12..1c7ff5f4d08fdffe6bcf513b140dc37e8e00ce54 100644 (file)
@@ -49,6 +49,16 @@ cmd_acl_mailbox_open(struct doveadm_mail_cmd_context *ctx,
                mailbox_free(&box);
                return -1;
        }
+
+       /* check that ACLs are enabled */
+       struct acl_mailbox *abox = ACL_CONTEXT(box);
+       if (abox == NULL) {
+               e_error(box->event, "ACL not enabled for %s", user->username);
+               doveadm_mail_failed_error(ctx, MAIL_ERROR_NOTFOUND);
+                mailbox_free(&box);
+               return -1;
+       }
+
        *box_r = box;
        return 0;
 }