JDK-4760881 : bad file name canonicalization causes jck and regression failures on win32
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.io
  • Affected Version: 1.4.2
  • Priority: P1
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2002-10-10
  • Updated: 2002-11-14
  • Resolved: 2002-10-25
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.
Other
1.4.2 mantisFixed
Related Reports
Relates :  
Relates :  
Description
JCK test:
  api/java_io/Serialization/descriptions.html#FilePermissions

Regression test:
  test/java/io/pathNames/GeneralWin32.java

These tests fail on win32 only.

Modification of java.io.FilePermission.equals to show the contents of
this/that.mask, this/that.cpath, this/that.directory, and this/that.recursive,
indicates that the two tests fail due to path canonicalization problems.

#Test Results (version 2)
#Wed Oct 09 17:58:00 PDT 2002
#checksum:59d35a3813b90591
#-----testdescription-----
$file=Y:\\iris\\work\\JCK-runtime-14\\tests\\api\\java_io\\Serialization\\descriptions.html
$root=Y:\\iris\\work\\JCK-runtime-14\\tests
executeArgs=-TestCaseID ALL -TestURL $testURL -FileName fileperm.ser
executeClass=javasoft.sqe.tests.api.java.io.Serialization.FilePermissionTests
id=FilePermission
keywords=positive runtime
source=FilePermissionTests.java
title=FilePermission serialize tests

#-----environment-----
ExecJCKTestOtherJVMCmd=javasoft.sqe.javatest.lib.ExecJCKTestOtherJVMCmd
command.testExecute=$ExecJCKTestOtherJVMCmd CLASSPATH=$testSuiteRootDir$/..$/classes PATH=$PATH SystemRoot=c:$/winnt y:$/iris$/work$/mantis$/build$/windows-i586$/bin$/java -Xfuture -Djava.security.policy=$testSuiteRootDir$/..$/lib$/jck.policy -Djava.rmi.activation.port=${java.rmi.activation.port} $testExecuteClass $testExecuteArgs

#-----testresult-----
description=file:///Y:/iris/work/JCK-runtime-14/tests/api/java_io/Serialization/descriptions.html#FilePermission
end=Wed Oct 09 17:58:00 PDT 2002
environment=jck-runtime-winNT
execStatus=Failed. tests: 2; failed: 2; first test case failure: testRead
javatestOS=Windows NT 4.0 (x86)
javatestVersion=2.1.6
script=com.sun.jck.lib.JCKScript 
sections=script_messages testExecute
start=Wed Oct 09 17:57:58 PDT 2002
status=Failed. tests: 2; failed: 2; first test case failure: testRead
test=api/java_io/Serialization/descriptions.html#FilePermission
timeoutSeconds=600
work=Y:\\iris\\work\\2002100925\\work\\api\\java_io\\Serialization

#section:script_messages
----------messages:(1/25)----------
Executing test class...

#section:testExecute
----------messages:(1/535)*----------
command: javasoft.sqe.javatest.lib.ExecJCKTestOtherJVMCmd CLASSPATH=Y:\\iris\\work\\JCK-runtime-14\\tests\\..\\classes PATH= SystemRoot=c:\\winnt y:\\iris\\work\\mantis\\build\\windows-i586\\bin\\java -Xfuture -Djava.security.policy=Y:\\iris\\work\\JCK-runtime-14\\tests\\..\\lib\\jck.policy -Djava.rmi.activation.port= javasoft.sqe.tests.api.java.io.Serialization.FilePermissionTests -TestCaseID ALL -TestURL file:///Y:/iris/work/JCK-runtime-14/tests/api/java_io/Serialization/descriptions.html#FilePermission -FileName fileperm.ser
----------ref:(170/3902)*----------
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: /path/* Y:\\path\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\iris\\work\\JCK-runtime-14 Y:\\iris\\work\\JCK-runtime-14
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\ Y:\FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\* Y:\\*
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 2 2
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 1 1
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 8 8
FP.eq cpath: Y:\\- Y:\\-
FP.eq dir: false false
FP.eq rec: false false
Fp.eq inst
FP.eq mask: 4 4
FP.eq cpath: /path/* Y:\\path\\*
FP.eq dir: false false
FP.eq rec: false false
----------log:(3/329)----------
testRead: Failed. Equals test, expected: (java.io.FilePermission /path/* read), received: (java.io.FilePermission /path/* read)
testWrite: Failed. Equals test, expected: (java.io.FilePermission /path/* read), received: (java.io.FilePermission /path/* read)
STATUS:Failed.tests: 2; failed: 2; first test case failure: testRead
result: Failed. tests: 2; failed: 2; first test case failure: testRead


test result: Failed. tests: 2; failed: 2; first test case failure: testRead

-- iag@sfbay 2002-10-09

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mantis FIXED IN: mantis INTEGRATED IN: mantis mantis-b05 VERIFIED IN: mantis
14-06-2004

EVALUATION The problem is that the implicit spec of FileSystem.canonicalize() is to throw an IOException if the file does not exist, but hits in the prefix cache are not testing for the existence of the file. The same problem exists in the UnixFileSystem implementation, though since that is only used for files within the JDK it isn't causing a failure in this JCK test. ###@###.### 2002-10-10 The above evaluation is incorrect. The root cause is that there are multiple subtle behaviors of FileSystem.canonicalize(), resulting in (variously) IOExceptions being thrown or other non-fatal results being returned from the operation. The problem is however isolated to the use of the prefix cache for canonicalization. The native code on Windows and Solaris has been examined and the new routine parentOrNull() has been restructured to bail out of complicated situations (like file names containing "..".) When parentOrNull returns null it simply uses the existing, expensive, canonicalization code. Now it is much more conservative in returning non-null results. Fixed in 1.4.2 b05. ###@###.### 2002-10-23
23-10-2002