directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ersi...@apache.org
Subject svn commit: r433584 - /directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Date Tue, 22 Aug 2006 10:48:07 GMT
Author: ersiner
Date: Tue Aug 22 03:48:07 2006
New Revision: 433584

URL: http://svn.apache.org/viewvc?rev=433584&view=rev
Log:
Complete fix for http://issues.apache.org/jira/browse/DIRSERVER-630.

Modified:
    directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java

Modified: directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
URL: http://svn.apache.org/viewvc/directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java?rev=433584&r1=433583&r2=433584&view=diff
==============================================================================
--- directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
(original)
+++ directory/trunks/apacheds/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java
Tue Aug 22 03:48:07 2006
@@ -670,6 +670,12 @@
             if ( modOp == DirContext.ADD_ATTRIBUTE )
             {
                 tmpEntryForAdd.put( change );
+                if ( change.size() == 0 )
+                {
+                    // not ok for add but ok for replace and delete
+                    throw new LdapInvalidAttributeValueException( "No value is not a valid
value for an attribute.", 
+                        ResultCodeEnum.INVALIDATTRIBUTESYNTAX );
+                }
             }
 
             if ( modOp == DirContext.REMOVE_ATTRIBUTE && entry.get( change.getID()
) == null )
@@ -790,10 +796,10 @@
             }
             
             // Freak out under some weird cases
-            if ( mods[0].getAttribute().size() == 0 )
+            if ( mods[ii].getAttribute().size() == 0 )
             {
                 // not ok for add but ok for replace and delete
-                if ( mods[0].getModificationOp() == DirContext.ADD_ATTRIBUTE )
+                if ( mods[ii].getModificationOp() == DirContext.ADD_ATTRIBUTE )
                 {
                     throw new LdapInvalidAttributeValueException( "No value is not a valid
value for an attribute.", 
                         ResultCodeEnum.INVALIDATTRIBUTESYNTAX );



Mime
View raw message