United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6866804 (file) Path calls checkPermission insteadof checkXXX (sol)
6866804 : (file) Path calls checkPermission insteadof checkXXX (sol)

Details
Type:
Bug
Submit Date:
2009-07-30
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2009-08-28
Component:
core-libs
OS:
solaris
Sub-Component:
java.nio
CPU:
x86
Priority:
P3
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
7

Related Reports

Sub Tasks

Description
Spec for java.nio.file.Path methods says when security manager is installed SecurityManager.checkRead(String) and SecurityManager.checkWrite(String file) methdos get called. But what is happening is in unix implementations SecurityManager.checkPermission(Permission p) is getting called insteadof checkRead(String file).

Specificallt Path.isSameFile() says "In the case of the default provider, and a security manager is installed, sm.checkRead(String file) method is invoked to check read access to both files". In Solaris and Linux it calls checkPermission(Permission) where as in windows it calls checkRead(String file).  

Attached test cases PathSecurityTest01 and PathSecurityTest02 passes in Windows fails in Solaris and Linux.

                                    

Comments
EVALUATION

Yes, this is a bug. The experimental file permission caching should have been removed before the code was pushed to jdk7.
                                     
2009-07-30



Hardware and Software, Engineered to Work Together