https://issues.apache.org/bugzilla/show_bug.cgi?id=49178

--- Comment #4 from Konstantin Kolinko <knst.koli...@gmail.com> 2010-04-27 
08:43:08 EDT ---
Created an attachment (id=25362)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=25362)
Bug49178PermissionUrlTest.java - sample code to check Java API behaviour

The preceding slash in the permission is how Java behaves. It is not specific
to Tomcat.

I am attaching a sample class that demonstrates Java API behaviour. When I am
running it on Windows XP with Sun JRE 6u20 as
 "java -cp . Bug49178PermissionUrlTest c:\projects\sample.txt"
it prints:

// File:
C:\PROJECTS\sample.txt
// URL:
file:/C:/PROJECTS/sample.txt
// URL.getPath():
/C:/PROJECTS/sample.txt
// URLConnection.getPermission():
(java.io.FilePermission \C:\PROJECTS\sample.txt read)
// File(url.getPath()).getCanonicalPath()
C:\PROJECTS\sample.txt
// FilePermission.equals()
true

The Permission is printed with preceding slash, but that does not matter,
because the FilePermissions are compared by canonical paths, and the canonical
path is constructed correctly regardless of that slash.

Suresh,  are you running with separate CATALINA_HOME and CATALINA_BASE? The
classes mentioned in the "access denied" stacktrace -- where their jars are
located?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to