You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by "Alex Karasulu (JIRA)" <di...@incubator.apache.org> on 2005/03/24 01:55:20 UTC

[jira] Updated: (DIREVE-150) GlobalOidRegistry.getOid(String) does not find bootstrap OIDs for uppercase names.

     [ http://issues.apache.org/jira/browse/DIREVE-150?page=history ]

Alex Karasulu updated DIREVE-150:
---------------------------------

    Fix Version: 0.9

> 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.8.1, 0.9
>  Environment: NA
>     Reporter: Jacob S. Barrett
>     Assignee: Alex Karasulu
>      Fix For: 0.9

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