You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2002/10/11 18:38:40 UTC

cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/util/compat Jdk12Support.java

costin      2002/10/11 09:38:40

  Modified:    src/share/org/apache/tomcat/util/compat Jdk12Support.java
  Log:
  Add the ability to pass a ProtectionDomain.
  This will allow more flexibility - you can use the webapp
  protection domain without needing an actual call from the app.
  
  Revision  Changes    Path
  1.12      +14 -2     jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java
  
  Index: Jdk12Support.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/util/compat/Jdk12Support.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Jdk12Support.java	13 Sep 2002 04:47:02 -0000	1.11
  +++ Jdk12Support.java	11 Oct 2002 16:38:40 -0000	1.12
  @@ -85,8 +85,20 @@
   	return AccessController.getContext();
       }
       
  -    public Object doPrivileged( Action action, Object accO ) throws Exception {
  -	AccessControlContext acc=(AccessControlContext)accO;
  +    public Object doPrivileged( Action action, Object accObj ) throws Exception {
  +        ProtectionDomain domain[]=null;
  +        if ( accObj instanceof ProtectionDomain ) {
  +            domain=new ProtectionDomain[1];
  +            domain[0]=(ProtectionDomain)accObj;
  +        } else if (accObj instanceof ProtectionDomain[] ) {
  +            domain=(ProtectionDomain []) accObj;
  +        }
  +	AccessControlContext acc=null;
  +        if( domain==null ) {
  +            acc=(AccessControlContext)accObj;
  +        } else {
  +            acc=new AccessControlContext( domain );
  +        }
   	if( acc==null )
   	    throw new Exception("Invalid access control context ");
   	Object proxy=action.getProxy();
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>