You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by gl...@apache.org on 2003/10/11 16:37:01 UTC

cvs commit: jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res LocalStrings.properties

glenn       2003/10/11 07:37:01

  Modified:    util/java/org/apache/tomcat/util/net PoolTcpEndpoint.java
               util/java/org/apache/tomcat/util/net/res
                        LocalStrings.properties
  Log:
  Catch AccessControlException's so that unauthorized access
  to a socket when using the Java SecurityManager does not
  shutdown the worker thread.
  
  Revision  Changes    Path
  1.22      +13 -3     jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
  
  Index: PoolTcpEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- PoolTcpEndpoint.java	4 Oct 2003 18:05:29 -0000	1.21
  +++ PoolTcpEndpoint.java	11 Oct 2003 14:37:00 -0000	1.22
  @@ -71,6 +71,7 @@
   import java.net.ServerSocket;
   import java.net.Socket;
   import java.net.SocketException;
  +import java.security.AccessControlException;
   
   import org.apache.commons.logging.Log;
   import org.apache.commons.logging.LogFactory;
  @@ -384,6 +385,15 @@
               // normal part -- should happen regularly so
               // that the endpoint can release if the server
               // is shutdown.
  +        }
  +        catch (AccessControlException ace) {
  +            // When using the Java SecurityManager this exception
  +            // can be thrown if you are restricting access to the
  +            // socket with SocketPermission's.
  +            // Log the unauthorized access and continue
  +            String msg = sm.getString("endpoint.warn.security",
  +                                      serverSocket,ace);
  +            log.warn(msg);
           }
           catch (IOException e) {
   
  
  
  
  1.4       +1 -0      jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties
  
  Index: LocalStrings.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/res/LocalStrings.properties,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- LocalStrings.properties	10 Jan 2003 20:22:38 -0000	1.3
  +++ LocalStrings.properties	11 Oct 2003 14:37:00 -0000	1.4
  @@ -3,3 +3,4 @@
   endpoint.err.nonfatal=Endpoint {0} ignored exception: {1}
   endpoint.warn.reinit=Reinitializing ServerSocket
   endpoint.warn.restart=Restarting endpoint
  +endpoint.warn.security=Endpoint {0} security exception: {1}
  
  
  

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