equal
deleted
inserted
replaced
212 type = AclEntryType.DENY; |
212 type = AclEntryType.DENY; |
213 } |
213 } |
214 |
214 |
215 // map flags |
215 // map flags |
216 byte aceFlags = unsafe.getByte(aceAddress + OFFSETOF_FLAGS); |
216 byte aceFlags = unsafe.getByte(aceAddress + OFFSETOF_FLAGS); |
217 Set<AclEntryFlag> flags = new HashSet<AclEntryFlag>(); |
217 Set<AclEntryFlag> flags = EnumSet.noneOf(AclEntryFlag.class); |
218 if ((aceFlags & OBJECT_INHERIT_ACE) != 0) |
218 if ((aceFlags & OBJECT_INHERIT_ACE) != 0) |
219 flags.add(AclEntryFlag.FILE_INHERIT); |
219 flags.add(AclEntryFlag.FILE_INHERIT); |
220 if ((aceFlags & CONTAINER_INHERIT_ACE) != 0) |
220 if ((aceFlags & CONTAINER_INHERIT_ACE) != 0) |
221 flags.add(AclEntryFlag.DIRECTORY_INHERIT); |
221 flags.add(AclEntryFlag.DIRECTORY_INHERIT); |
222 if ((aceFlags & NO_PROPAGATE_INHERIT_ACE) != 0) |
222 if ((aceFlags & NO_PROPAGATE_INHERIT_ACE) != 0) |
224 if ((aceFlags & INHERIT_ONLY_ACE) != 0) |
224 if ((aceFlags & INHERIT_ONLY_ACE) != 0) |
225 flags.add(AclEntryFlag.INHERIT_ONLY); |
225 flags.add(AclEntryFlag.INHERIT_ONLY); |
226 |
226 |
227 // map access mask |
227 // map access mask |
228 int mask = unsafe.getInt(aceAddress + OFFSETOF_ACCESS_MASK); |
228 int mask = unsafe.getInt(aceAddress + OFFSETOF_ACCESS_MASK); |
229 Set<AclEntryPermission> perms = new HashSet<AclEntryPermission>(); |
229 Set<AclEntryPermission> perms = EnumSet.noneOf(AclEntryPermission.class); |
230 if ((mask & FILE_READ_DATA) > 0) |
230 if ((mask & FILE_READ_DATA) > 0) |
231 perms.add(AclEntryPermission.READ_DATA); |
231 perms.add(AclEntryPermission.READ_DATA); |
232 if ((mask & FILE_WRITE_DATA) > 0) |
232 if ((mask & FILE_WRITE_DATA) > 0) |
233 perms.add(AclEntryPermission.WRITE_DATA); |
233 perms.add(AclEntryPermission.WRITE_DATA); |
234 if ((mask & FILE_APPEND_DATA ) > 0) |
234 if ((mask & FILE_APPEND_DATA ) > 0) |
376 aceCount = 0; |
376 aceCount = 0; |
377 } else { |
377 } else { |
378 AclInformation aclInfo = GetAclInformation(aclAddress); |
378 AclInformation aclInfo = GetAclInformation(aclAddress); |
379 aceCount = aclInfo.aceCount(); |
379 aceCount = aclInfo.aceCount(); |
380 } |
380 } |
381 ArrayList<AclEntry> result = new ArrayList<AclEntry>(aceCount); |
381 ArrayList<AclEntry> result = new ArrayList<>(aceCount); |
382 |
382 |
383 // decode each of the ACEs to AclEntry objects |
383 // decode each of the ACEs to AclEntry objects |
384 for (int i=0; i<aceCount; i++) { |
384 for (int i=0; i<aceCount; i++) { |
385 long aceAddress = GetAce(aclAddress, i); |
385 long aceAddress = GetAce(aclAddress, i); |
386 AclEntry entry = decode(aceAddress); |
386 AclEntry entry = decode(aceAddress); |