]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Don't crash when creating children under a mailboxes with global ACL.
authorTimo Sirainen <tss@iki.fi>
Mon, 14 Sep 2009 01:10:33 +0000 (21:10 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 14 Sep 2009 01:10:33 +0000 (21:10 -0400)
--HG--
branch : HEAD

src/plugins/acl/acl-mailbox.c

index ba1d699ba2efc8cf9e33d3d1ed06ffefdfb536f5..8214492cc5b323f361803fa4347fa6d13502369f 100644 (file)
@@ -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);
 }