mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

matthew_swift
19.26.2009 a2b075f791cc543fe6fdba378225512f798f2071
Fix broken ldapSubentry filter detection and re-enable translateRubEntryTest.
2 files modified
47 ■■■■ changed files
opends/src/server/org/opends/server/core/SearchOperationBasis.java 45 ●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/PersistentServerStateTest.java 2 ●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/core/SearchOperationBasis.java
@@ -1464,28 +1464,6 @@
   */
  private void checkFilterForLDAPSubEntry(SearchFilter filter, int depth)
  {
    switch (filter.getFilterType())
    {
      case EQUALITY:
      case AND:
      case OR:
        for (SearchFilter f : filter.getFilterComponents())
        {
          if (f.getFilterType() == FilterType.EQUALITY)
          {
            if (f.getAttributeType().isObjectClassType())
            {
              AttributeValue v = f.getAssertionValue();
              if (toLowerCase(v.getValue().toString(
                  )).equals("ldapsubentry"))
              {
                setReturnLDAPSubentries(true);
                return;
              }
            }
          }
          else
          {
            // Paranoid check to avoid recursion deep enough to provoke
            // the stack overflow. This should never happen because if
            // a given filter is too nested SearchFilter exception gets
@@ -1498,9 +1476,32 @@
              }
              return;
            }
    switch (filter.getFilterType())
    {
    case EQUALITY:
      if (filter.getAttributeType().isObjectClassType())
      {
        AttributeValue v = filter.getAssertionValue();
        if (toLowerCase(v.getValue().toString()).equals("ldapsubentry"))
        {
          setReturnLDAPSubentries(true);
        }
      }
      break;
    case AND:
    case OR:
      for (SearchFilter f : filter.getFilterComponents())
      {
            checkFilterForLDAPSubEntry(f, depth + 1);
        if (isReturnLDAPSubentries())
        {
          // No point in continuing.
          break;
          }
        }
      break;
    }
  }
}
opends/tests/unit-tests-testng/src/server/org/opends/server/replication/plugin/PersistentServerStateTest.java
@@ -119,7 +119,7 @@
   * @throws  Exception  If an unexpected problem occurs.
   */
  @SuppressWarnings("unchecked")
  @Test(enabled = false)
  @Test
  public void translateRuvEntryTest()
         throws Exception
  {