JDK-8164705 : Remove pathname canonicalization from FilePermission
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-08-24
  • Updated: 2018-07-10
  • Resolved: 2016-10-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b140Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Sub Tasks
JDK-8165836 :  
Description
Remove the pathname canonicalization process in FilePermission, so that only the original pathname argument is used in the implies, equals and hashCode methods. This should significantly improve the performance and fix some old bugs (See Issue Links).

The compatibility impact of this change will be high, because implies() relation between 2 FilePermissions will change, especially if one is on a relative path and the other on an absolute path, or one on a symlink and the other on a target. A FilePermission could be granted in several ways:

- By a policy. For example, a policy file.

- Automatically by a class loader. For example, the FilePermission doc asserts that "Code can always read a file from the same directory it's in (or a subdirectory of that directory); it does not need explicit permission to do so". One can see this behavior implemented in the getPermissions() methods of various ClassLoader implementations, currently including URLClassLoader, BuiltinClassLoader and Loader.

- By a doPrivileged-with-permissions call.

Comments
verified in jdk9-b156
15-02-2017

Review thread: http://mail.openjdk.java.net/pipermail/core-libs-dev/2016-September/043263.html
07-09-2016