tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antony Bowesman <...@teamware.com>
Subject Last straw - AccessControlException problem
Date Wed, 14 Nov 2001 15:12:07 GMT
Hi,

I'm getting an AccessControlException when trying to read the file
H:\Apache\jakarta-tomcat-4.0\bin\user.txt

Top part of stack trace is

java.security.AccessControlException: access denied
(java.io.FilePermission user.txt read)
        at
java.security.AccessControlContext.checkPermission(AccessControlContext.java:272)
        at
java.security.AccessController.checkPermission(AccessController.java:399)
        at
java.lang.SecurityManager.checkPermission(SecurityManager.java:545)
        at java.lang.SecurityManager.checkRead(SecurityManager.java:890)
        at java.io.FileInputStream.<init>(FileInputStream.java:61)
        at java.io.FileReader.<init>(FileReader.java:38)
        at
com.teamware.phoenix.security.auth.spi.TestLoginModule.login(Unknown
Source)
        at
com.teamware.phoenix.security.auth.spi.ProxyLoginModule.login(ProxyLoginModule.java:152)

My ProxyLoginModule is in file:${catalina.home}/bin/jaasproxylogin.jar
and catalina.policy has the following grant entry

grant codeBase "file:${catalina.home}/bin/jaasproxylogin.jar" {
       permission java.lang.RuntimePermission "getClassLoader";
       permission java.util.PropertyPermission "log4j.configuration",
"read";
       permission java.util.PropertyPermission "log4j.configDebug",
"read";
       permission java.util.PropertyPermission "user.dir", "read";
       permission java.util.FilePermission
"H:\\Apache\\jakarta-tomcat-4.0\\bin\\user.txt", "read";
       permission java.util.FilePermission "user.txt", "read";
};

The code does

  String fileName = "user.txt"; 
  File f = new File(fileName);
  System.out.println("Path=" + f.getAbsolutePath());
  BufferedReader br = new BufferedReader(new FileReader(fileName));

The output is

Path=H:\Apache\jakarta-tomcat-4.0\bin\user.txt

If I remove the PropertyPermission for user.dir I get an ACE on the
getAbsolutePath() call, this shows it is taking the grant entry.  Can
anyone see what's wrong with the grant entry.  I've tried the same with
no codebase and it does not work.  I've tried 

       permission java.util.FilePermission "<<ALL FILES>>", "read";

still doesn't work.

I'm running 4.0 on WinXP.

Antony


-- 
Antony Bowesman
Teamware Group 
adb@teamware.com
phone: +358 9 5128 2562
fax  : +358 9 5128 2705

intra / extra / Internet solutions at www.teamware.com

--
To unsubscribe:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands: <mailto:tomcat-user-help@jakarta.apache.org>
Troubles with the list: <mailto:tomcat-user-owner@jakarta.apache.org>


Mime
View raw message