The fix to JDK-8229888 doesn't work on e.g. CIFS share, a directory mounted on a Linux with mount.cifs from a Windows server (which is a reverse configuration to the reported in discussion for that bug). There are plenty of these everywhere: Azure shares, corporate NASes exported in CIFS etc. A non-root account could do almost anything there but an attempt to set Unix permissions would fail with non-zero exit status.
Now, exactly this happens in ZipFileSystem::sync() :
if (attrs != null) {
Files.setPosixFilePermissions(tmpFile, attrs.permissions());
}
Attribute view of this CIFS share is supported but not fully. As a result, there is a java.nio.file.FileSystemException and updating of a zip file totally fails.
It's a regression. Fix is, I think, to catch and ignore java.nio.file.FileSystemException.
Now, exactly this happens in ZipFileSystem::sync() :
if (attrs != null) {
Files.setPosixFilePermissions(tmpFile, attrs.permissions());
}
Attribute view of this CIFS share is supported but not fully. As a result, there is a java.nio.file.FileSystemException and updating of a zip file totally fails.
It's a regression. Fix is, I think, to catch and ignore java.nio.file.FileSystemException.
- relates to
-
JDK-8229888 (zipfs) Updating an existing zip file does not preserve original permissions
-
- Resolved
-