You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Torsten Fohrer <To...@dcsi.de> on 2003/01/16 11:27:29 UTC
Problem with SecurityManager
How do i configure the Security Manager to use different policies for each
host/webapp/webapp(libs/classes)?
Example:
1. Install a clean Tomcat 4.1.xx
2. Creating a simple jsp page in examples/securityTest.jsp
securityTest.jsp
--->
<% secure.secureClass.readPasswd() %>
<---
3. Create a class secure.secureClass in examples/web-inf/classes
--->
package secure;
import java.io.*;
public class secureClass {
public static void readPasswd() throws Exception {
File x = new File("/etc/passwd");
x.canRead();
}
}
<---
4. Adding to catalina.policy
grant "file:${catalina.home}/webapps/examples/WEB-INF/classes/-" {
java.io.FilePermission "/etc/passwd", "read";
};
5. starting tomcat with security manager
6. request securityTest.jsp => Security Exception?
what i do wrong?
Torsten Fohrer
**********************************************************
* DCSI AG * Tel.: +49 7131 155 88-0 *
* Lessingstrasse 17-19 * Fax.: +49 7131 155 88-99 *
* D-74076 Heilbronn * tf@dcsi.de *
* GERMANY * http://www.dcsi.de *
**********************************************************
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>