directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r595845 - /directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java
Date Fri, 16 Nov 2007 22:24:02 GMT
Author: akarasulu
Date: Fri Nov 16 14:23:54 2007
New Revision: 595845

URL: http://svn.apache.org/viewvc?rev=595845&view=rev
Log:
fixing bug where it is possible to pump byte[] values into with valid utf8 string into normalizers

Modified:
    directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java

Modified: directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java?rev=595845&r1=595844&r2=595845&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java
(original)
+++ directory/apacheds/branches/bigbang/schema-registries/src/main/java/org/apache/directory/server/schema/NameAndOptionalUIDNormalizer.java
Fri Nov 16 14:23:54 2007
@@ -20,12 +20,13 @@
 package org.apache.directory.server.schema;
 
 
-import javax.naming.NamingException;
-
 import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
 import org.apache.directory.server.schema.registries.Registries;
 import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.directory.shared.ldap.schema.Normalizer;
+import org.apache.directory.shared.ldap.util.StringTools;
+
+import javax.naming.NamingException;
 
 
 /**
@@ -60,6 +61,11 @@
 
     public Object normalize( Object value ) throws NamingException
     {
+        if ( value instanceof byte[] )
+        {
+            value = StringTools.utf8ToString( ( byte[] ) value );
+        }
+
         if ( value instanceof String )
         {
             String nameAndUid = (String)value;



Mime
View raw message