From: Timo Sirainen Date: Mon, 14 Sep 2009 01:10:33 +0000 (-0400) Subject: acl: Don't crash when creating children under a mailboxes with global ACL. X-Git-Tag: 2.0.alpha1~117 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4264d75117668afed3c3602116dcf159463644e6;p=thirdparty%2Fdovecot%2Fcore.git acl: Don't crash when creating children under a mailboxes with global ACL. --HG-- branch : HEAD --- diff --git a/src/plugins/acl/acl-mailbox.c b/src/plugins/acl/acl-mailbox.c index ba1d699ba2..8214492cc5 100644 --- a/src/plugins/acl/acl-mailbox.c +++ b/src/plugins/acl/acl-mailbox.c @@ -116,8 +116,11 @@ static void acl_mailbox_copy_acls_from_parent(struct mailbox *box) parent_aclobj = acl_object_init_from_parent(alist->rights.backend, box->name); iter = acl_object_list_init(parent_aclobj); - while (acl_object_list_next(iter, &update.rights) > 0) - (void)acl_object_update(abox->aclobj, &update); + while (acl_object_list_next(iter, &update.rights) > 0) { + /* don't copy global ACL rights. */ + if (!update.rights.global) + (void)acl_object_update(abox->aclobj, &update); + } acl_object_list_deinit(&iter); acl_object_deinit(&parent_aclobj); }