tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator AuthenticatorBase.java
Date Wed, 07 Jan 2004 23:38:13 GMT
markt       2004/01/07 15:38:13

  Modified:    catalina/src/share/org/apache/catalina/authenticator
                        AuthenticatorBase.java
  Log:
  - Fix bug 11875. A (very) minor optimisation but it closes a bug report.
  - Patch provided by Per Kreipke
  
  Revision  Changes    Path
  1.40      +9 -7      jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java
  
  Index: AuthenticatorBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/authenticator/AuthenticatorBase.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- AuthenticatorBase.java	24 Dec 2003 20:40:50 -0000	1.39
  +++ AuthenticatorBase.java	7 Jan 2004 23:38:13 -0000	1.40
  @@ -613,19 +613,21 @@
           }
   
           // Check each role included in this constraint
  -        Realm realm = context.getRealm();
  +        if (constraint.getAllRoles())
  +            return (true);
  +        
           String roles[] = constraint.findAuthRoles();
           if (roles == null)
               roles = new String[0];
   
  -        if (constraint.getAllRoles())
  -            return (true);
           if ((roles.length == 0) && (constraint.getAuthConstraint())) {
               ((HttpServletResponse) response.getResponse()).sendError
                   (HttpServletResponse.SC_FORBIDDEN,
                    sm.getString("authenticator.forbidden"));
               return (false); // No listed roles means no access at all
           }
  +        
  +        Realm realm = context.getRealm();
           for (int i = 0; i < roles.length; i++) {
               if (realm.hasRole(principal, roles[i]))
                   return (true);
  
  
  

---------------------------------------------------------------------
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