directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacob S. Barrett (JIRA)" <directory-...@incubator.apache.org>
Subject [jira] Created: (DIREVE-150) GlobalOidRegistry.getOid(String) does not find bootstrap OIDs for uppercase names.
Date Fri, 18 Mar 2005 21:11:20 GMT
GlobalOidRegistry.getOid(String) does not find bootstrap OIDs for uppercase names.
----------------------------------------------------------------------------------

         Key: DIREVE-150
         URL: http://issues.apache.org/jira/browse/DIREVE-150
     Project: Directory Server
        Type: Bug
  Components: schema  
    Versions: 0.8, 0.9, 0.8.1    
 Environment: NA
    Reporter: Jacob S. Barrett
 Assigned to: Alex Karasulu 


Some servers, like Microsoft Active Directory, use uppercase attribute names for some of the
bootstrap attributes.  For example, when proxying LDAP requests to an Active Directory where
"OU=Domain Controllers" entry is found the uppercase OU will cause a NamingException("OID
for name X was not found within the OID registry"). The patch below extends the search to
include the normalized search of bootstrap registry and caching of the unnormalized name in
the byName hashtable.

Patch:
Index: apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
===================================================================
--- apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
(revision 158112)
+++ apacheds/trunk/core/src/main/java/org/apache/ldap/server/schema/GlobalOidRegistry.java
(working copy)
@@ -142,16 +142,34 @@
          * returned on a getNameSet.
          */
         String lowerCase = name.trim().toLowerCase();
-        if ( ! name.equals( lowerCase )
-        && byName.containsKey( lowerCase ) )
-        {
-            String oid = ( String ) byName.get( lowerCase );
-            monitor.oidResolved( name, lowerCase, oid );
+        if ( ! name.equals( lowerCase ) )
+		{
+			if ( byName.containsKey( lowerCase ) )
+	        {
+	            String oid = ( String ) byName.get( lowerCase );
+	            monitor.oidResolved( name, lowerCase, oid );
+	
+	            // We expect to see this version of the key again so we add it
+	            byName.put( name, oid );
+	            return oid;
+	        }
+			
+			/*
+			 * Some LDAP servers (MS Active Directory) tend to use some of the
+			 * bootstrap oid names as all caps, like OU. This should resolve that.
+			 * Lets stash this in the byName if we find it.
+			 */
+			
+			if ( bootstrap.hasOid( lowerCase) )
+			{
+	            String oid = bootstrap.getOid( name );
+	            monitor.oidResolved( name, oid );
 
-            // We expect to see this version of the key again so we add it
-            byName.put( name, oid );
-            return oid;
-        }
+	            // We expect to see this version of the key again so we add it
+				byName.put( name, oid );
+	            return oid;
+			}
+		}
 
         NamingException fault = new NamingException ( "OID for name '"
                 + name + "' was not " + "found within the OID registry" );


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message