You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2008/07/09 23:21:20 UTC

svn commit: r675345 - in /directory/shared/branches/bigbang/ldap/src: main/java/org/apache/directory/shared/ldap/filter/FilterParser.java test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java

Author: elecharny
Date: Wed Jul  9 14:21:20 2008
New Revision: 675345

URL: http://svn.apache.org/viewvc?rev=675345&view=rev
Log:
Fixed DIRSERVER-1196
Added a test for it

Modified:
    directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
    directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java

Modified: directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java?rev=675345&r1=675344&r2=675345&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java (original)
+++ directory/shared/branches/bigbang/ldap/src/main/java/org/apache/directory/shared/ldap/filter/FilterParser.java Wed Jul  9 14:21:20 2008
@@ -307,6 +307,11 @@
 
                     pos.start++;
                 }
+                else
+                {
+                    // This is an error
+                    throw new ParseException( "Bad substring", pos.start );
+                }
             }
         }
         else

Modified: directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java
URL: http://svn.apache.org/viewvc/directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java?rev=675345&r1=675344&r2=675345&view=diff
==============================================================================
--- directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java (original)
+++ directory/shared/branches/bigbang/ldap/src/test/java/org/apache/directory/shared/ldap/filter/FilterParserTest.java Wed Jul  9 14:21:20 2008
@@ -664,6 +664,26 @@
     }
 
     
+    /**
+     * Test that special and non allowed chars into an assertionValue are not
+     * accepted. ((cf DIRSERVER-1196)
+     *
+     */
+    @Test
+    public void testSpecialCharsInMemberOf()
+    {
+        try
+        {
+            FilterParser.parse("(memberOf=1.2.840.113556.1.4.1301=$#@&*()==,2.5.4.11=local,2.5.4.11=users,2.5.4.11=readimanager)");
+            fail();
+        }
+        catch ( ParseException pe )
+        {
+            assertTrue( true );
+        }
+    }
+
+
     /*
     @Test
     public void testPerf() throws ParseException