From 8ee2303e781056d512c4d83ba76683c7c1496669 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Enrique=20J=2E=20Hern=C3=A1ndez=20Blasco?= Date: Thu, 19 Mar 2015 00:06:14 +0100 Subject: [PATCH] oc: Empty ACL from a folder works with several users The `[SOGoFolder:aclUsers]` returns a reference to a `NSArray` which is being modified in the `for` loop making fail when more than one user is in the ACL with `NSRangeException`. --- OpenChange/MAPIStoreFolder.m | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OpenChange/MAPIStoreFolder.m b/OpenChange/MAPIStoreFolder.m index 19c826d7f..0d862b85e 100644 --- a/OpenChange/MAPIStoreFolder.m +++ b/OpenChange/MAPIStoreFolder.m @@ -1745,10 +1745,12 @@ Class NSExceptionK, MAPIStoreFAIMessageK, MAPIStoreMessageTableK, MAPIStoreFAIMe aclFolder = [self aclFolder]; - users = [aclFolder aclUsers]; + users = [[aclFolder aclUsers] copy]; max = [users count]; for (count = 0; count < max; count++) [aclFolder removeUserFromAcls: [users objectAtIndex: count]]; + + [users release]; } - (int) modifyPermissions: (struct PermissionData *) permissions