tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Glenn Nielsen <gl...@voyager.apg.more.net>
Subject 3.3dev patch to merge into Tomcat 3.2
Date Fri, 17 Nov 2000 19:46:46 GMT
Here is another patch I made to 3.3dev that should probably be merged in to 3.2.

Regards,

Glenn

-------- Original Message --------
Subject: cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service
PoolTcpEndpoint.java
Date: 10 Aug 2000 20:44:49 -0000
From: glenn@locus.apache.org
Reply-To: tomcat-dev@jakarta.apache.org
To: jakarta-tomcat-cvs@apache.org

glenn       00/08/10 13:44:49

  Modified:    src/share/org/apache/tomcat/service PoolTcpEndpoint.java
  Log:
  When using the Java SecurityManager to set a security policy for what
  remote web servers can connect to tomcat using SocketPermission, if
  a remote web server tried to connect which was not permitted, the
  Socket would be closed.  Added code to detect an AccessControlException
  and log it without closing socket.  This should be jdk 1.1.x compatible.
  
  Revision  Changes    Path
  1.12      +14 -7    
jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===================================================================
  RCS file:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpEndpoint.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- PoolTcpEndpoint.java	2000/07/27 18:43:07	1.11
  +++ PoolTcpEndpoint.java	2000/08/10 20:44:49	1.12
  @@ -1,7 +1,7 @@
   /*
  - * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpEndpoint.java,v
1.11 2000/07/27 18:43:07 costin Exp $
  - * $Revision: 1.11 $
  - * $Date: 2000/07/27 18:43:07 $
  + * $Header:
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/PoolTcpEndpoint.java,v
1.12 2000/08/10 20:44:49 glenn Exp $
  + * $Revision: 1.12 $
  + * $Date: 2000/08/10 20:44:49 $
    *
    * ====================================================================
    *
  @@ -311,10 +311,17 @@
   	// exceptions, catch them here and log as above
   
   	catch(Throwable e) {
  -    	    String msg = sm.getString("endpoint.err.fatal",
  -				      serverSocket, e);
  -	    log(msg, e, Logger.ERROR);
  -	    stopEndpoint();	// safe to call this from inside thread pool?
  +            // If we are running with a SecurityManager, don't shutdown
Socket        
  +            // on an AccessControlException.
  +	    if(
e.getClass().getName().equals("java.security.AccessControlException") ) {
  +		String msg = "Socket: "+ serverSocket + " AccessControlException: " +
e.toString();
  +		log(msg, Logger.ERROR);
  +	    } else {
  +		String msg = sm.getString("endpoint.err.fatal",
  +					serverSocket, e);    
  +		log(msg, e, Logger.ERROR);
  +		stopEndpoint();	// safe to call this from inside thread pool?
  +	    }
       	}
   
       	return accepted;
  
  
  

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

Mime
View raw message