directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r537118 - in /directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz: AuthorizationService.java DefaultAuthorizationService.java
Date Fri, 11 May 2007 06:54:17 GMT
Author: elecharny
Date: Thu May 10 23:54:16 2007
New Revision: 537118

URL: http://svn.apache.org/viewvc?view=rev&rev=537118
Log:
Check the DN to avoid a normalization if it has already been done : this save 4% of CPU

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java?view=diff&rev=537118&r1=537117&r2=537118
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java
Thu May 10 23:54:16 2007
@@ -675,7 +675,11 @@
         Invocation invocation = InvocationStack.getInstance().peek();
         LdapPrincipal principal = ( ( ServerContext ) invocation.getCaller() ).getPrincipal();
         LdapDN principalDn = principal.getJndiName();
-        principalDn.normalize( attrRegistry.getNormalizerMapping() );
+        
+        if ( !principalDn.isNormalized() )
+        {
+        	principalDn.normalize( attrRegistry.getNormalizerMapping() );
+        }
         
         if ( isPrincipalAnAdministrator( principalDn ) || !enabled )
         {

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java?view=diff&rev=537118&r1=537117&r2=537118
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java
Thu May 10 23:54:16 2007
@@ -551,7 +551,11 @@
     {
         LdapDN principalDn = ( ( ServerContext ) invocation.getCaller() ).getPrincipal().getJndiName();
         LdapDN dn = ((ServerSearchResult)result).getDn();
-        dn.normalize( normalizerMapping );
+        
+        if ( !dn.isNormalized() )
+        {
+        	dn.normalize( normalizerMapping );
+        }
 
         // Admin users gets full access to all entries
         if ( isAnAdministrator( principalDn ) )



Mime
View raw message