RFR 8229888: Zip FS does not retain permissions when updating a Zip file

Alan Bateman Alan.Bateman at oracle.com
Tue Dec 10 08:32:48 UTC 2019


On 09/12/2019 18:28, Lance Andersen wrote:
> Here is a revised patch: 
> http://cr.openjdk.java.net/~lancea/8229888/webrev.01/index.html. 
This version looks better but there are still a few points that need 
discussion.

It's not clear to me why getPosixAttributes and setZipFileAttributes 
access the file system in privileged blocks. The jdk.zipfs has full 
access to the file system so I would have thought that access to the zip 
files should be restricted by the permissions of the caller.

If restoring any of the file permissions, owner or group fails then sync 
will fail. That needs a bit more study to see if it make sense or not. 
If the original zip file is owned by someone else then I suspect you may 
have to truncate and re-write it as the chown/chgrp will likely fail and 
will fail after the the original file has been replaced. It may be that 
the move into place has to be visited and replaced with a 
truncate/re-write in some cases to cover all the cases that you want.

-Alan





More information about the nio-dev mailing list