RFR 8213031: (zipfs) Add support for POSIX file permissions

Alan Bateman Alan.Bateman at oracle.com
Sun Mar 31 15:29:19 UTC 2019


On 20/03/2019 16:25, Langer, Christoph wrote:
> Hi Alan,
>
> I now found time to get back to the POSIX file permissions in zipfs. The goal would be to get it done for JDK13 ��
>
> :
>
> Here is an updated webrev: http://cr.openjdk.java.net/~clanger/webrevs/8213031.8/
>
> What's next?
>
I skimmed through the updated webrev and read your latest 
comments/replies and I think we are close.

One thing that is puzzling is that 
ZipFileAttributeView/ZipFileAttributes extend 
PosixFileAttributeView/PosixFileAttributes. I don't think that will work 
because the "zip" view is supported by default whereas "posix" view 
needs the file system to be created with enablePosixFileAttributes=true.

I saw your comment about naming the file permissions attribute 
"storedPermissions" in the zip view but if the zip and posix view are 
separated then I think it would be clearer to name it "permissions" in 
the zip view. If code is using Files.getAttribute then it will need the 
view name so they won't get mixed up.

You asked about the fallback when defaultOwner/defaultGroup aren't set. 
If getOwner fails with an IOException then I think that exception should 
be propagated. The UOE case will fallback to the value of "user.name". I 
think the fallback for the group owner should be the file owner rather 
than "
"<zipfs_default>". The default.policy file will need to be updated to 
grant jdk.zipfs RuntimePermission("accessUserInfo") so that you won't 
need to deal with security exceptions.

As regards next steps then I think we need to agree the spec changes, as 
in the the javadoc in module-info.java. Once we have the spec agreed 
then the CSR can be updated and finalized. The code review can be done 
in parallel of course. I think Lance is going to help review the changes.

-Alan




More information about the core-libs-dev mailing list