costin 01/02/11 19:26:38
Modified: src/share/org/apache/tomcat/startup Tomcat.java
Log:
Added the "sandbox" option - otherwise it's hard to start tomcat
with security manager if java -jar is used to start.
After M1 I'll propose the change of the scripts, there are quite a few problems
with sandboxing and the TOMCAT_HOME guessing on unix.
Revision Changes Path
1.56 +11 -0 jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java
Index: Tomcat.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/startup/Tomcat.java,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -r1.55 -r1.56
--- Tomcat.java 2001/02/10 19:17:28 1.55
+++ Tomcat.java 2001/02/12 03:26:38 1.56
@@ -31,6 +31,7 @@
String home=null;
String args[];
ClassLoader parentClassLoader;
+ boolean sandbox=false;
// null means user didn't set one
String configFile=null;
@@ -56,6 +57,10 @@
action=s;
}
+ public void setSandbox( boolean b ) {
+ sandbox=b;
+ }
+
public void setParentClassLoader( ClassLoader cl ) {
parentClassLoader=cl;
}
@@ -140,6 +145,8 @@
if (cl==null) cl=this.getClass().getClassLoader();
tcat.getContextManager().setParentLoader(cl);
+ if( sandbox )
+ tcat.getContextManager().setProperty( "sandbox", "true");
tcat.initContextManager();
tcat.start();
@@ -169,6 +176,10 @@
return false;
} else if (arg.equals("-stop")) {
action="stop";
+ } else if (arg.equals("-sandbox")) {
+ sandbox=true;
+ } else if (arg.equals("-security")) {
+ sandbox=true;
} else if (arg.equals("-enableAdmin")) {
action="enableAdmin";
} else if (arg.equals("-g") || arg.equals("-generateConfigs")) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]