directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1057254 - /directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Date Mon, 10 Jan 2011 16:09:06 GMT
Author: elecharny
Date: Mon Jan 10 16:09:06 2011
New Revision: 1057254

URL: http://svn.apache.org/viewvc?rev=1057254&view=rev
Log:
Added a check for the rename operation : invalid RDN will be rejected immediately with the
correct LdapException

Modified:
    directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java

Modified: directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java?rev=1057254&r1=1057253&r2=1057254&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
(original)
+++ directory/apacheds/branches/apacheds-AP/core/src/main/java/org/apache/directory/server/core/schema/SchemaInterceptor.java
Mon Jan 10 16:09:06 2011
@@ -949,6 +949,9 @@ public class SchemaInterceptor extends B
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void rename( NextInterceptor next, RenameOperationContext renameContext ) throws
LdapException
     {
         DN oldDn = renameContext.getDn();
@@ -987,10 +990,17 @@ public class SchemaInterceptor extends B
             }
         }
 
+        // Check the RDN
         for ( AVA atav : newRdn )
         {
             AttributeType type = schemaManager.lookupAttributeTypeRegistry( atav.getUpType()
);
 
+            if ( !type.getSyntax().getSyntaxChecker().isValidSyntax( atav.getNormValue()
) )
+            {
+                String message = "Invalid syntax '" + atav.getNormValue() + "' for the attributeType
" + type.getName();
+                throw new LdapInvalidAttributeValueException( ResultCodeEnum.INVALID_ATTRIBUTE_SYNTAX,
message );
+            }
+            
             if ( !entry.contains( type, atav.getNormValue() ) )
             {
                 entry.add( new DefaultEntryAttribute( type, atav.getUpValue() ) );



Mime
View raw message