changeset 9382:6df681067e0a HEAD

acl: Don't crash when creating children under a mailboxes with global ACL.
author Timo Sirainen <tss@iki.fi>
date Sun, 13 Sep 2009 21:09:33 -0400
parents 28241a6e1178
children 05eec45994d9
files src/plugins/acl/acl-storage.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/acl/acl-storage.c	Sun Sep 13 19:01:28 2009 -0400
+++ b/src/plugins/acl/acl-storage.c	Sun Sep 13 21:09:33 2009 -0400
@@ -156,8 +156,11 @@
 	parent_aclobj = acl_object_init_from_parent(astorage->rights.backend,
 						    storage, name);
 	iter = acl_object_list_init(parent_aclobj);
-	while (acl_object_list_next(iter, &update.rights) > 0)
-		(void)acl_object_update(child_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(child_aclobj, &update);
+	}
 	acl_object_list_deinit(&iter);
 	acl_object_deinit(&parent_aclobj);
 	acl_object_deinit(&child_aclobj);