From: Timo Sirainen Date: Sun, 12 Feb 2012 17:16:34 +0000 (+0200) Subject: acl: After checking we have rights to create mailbox, ignore any further ACL checks. X-Git-Tag: 2.1.rc6~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b53bec99f804caa67f85c3523435ba9f4502c2d7;p=thirdparty%2Fdovecot%2Fcore.git acl: After checking we have rights to create mailbox, ignore any further ACL checks. --- diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index 3efa0aa528..54c0b2cf01 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -122,13 +122,18 @@ acl_mailbox_create(struct mailbox *box, const struct mailbox_update *update, bool directory) { struct acl_mailbox *abox = ACL_CONTEXT(box); + int ret; - /* we already checked permissions in list.mailbox_create_dir(). */ - if (abox->module_ctx.super.create(box, update, directory) < 0) - return -1; - - acl_mailbox_copy_acls_from_parent(box); - return 0; + /* we already checked permissions in list.mailbox_create_dir(). + ignore ACLs in this mailbox until creation is complete, because + super.create() may call e.g. mailbox_open() which will fail since + we haven't yet copied ACLs to this mailbox. */ + abox->skip_acl_checks = TRUE; + ret = abox->module_ctx.super.create(box, update, directory); + abox->skip_acl_checks = FALSE; + if (ret == 0) + acl_mailbox_copy_acls_from_parent(box); + return ret; } static int