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

Matthew Swift
04.02.2016 0dc92501320b3dc23fbe26815463a4e1c92f9393
OPENDJ-2813 Tolerate malformed attribute descriptions when filtering entries

LDAP RFC 4511 specifies that a search operation's attribute list should
comprise of either "*", "+", or a valid attribute description. There is
also an extension which allows clients to specify object classes using
"@" prefixes.

Following the principle of being tolerant when receiving protocol, this
change relaxes the parsing of attribute descriptions such that invalid
attribute descriptions are simply ignored.
1 files modified
13 ■■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java 13 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/types/Entry.java
@@ -4431,7 +4431,18 @@
          continue;
        }
        AttributeDescription attrDesc = AttributeDescription.valueOf(attrName);
        final AttributeDescription attrDesc;
        try
        {
          attrDesc = AttributeDescription.valueOf(attrName);
        }
        catch (LocalizedIllegalArgumentException e)
        {
          // For compatibility tolerate and ignore illegal attribute types, instead of
          // aborting with a ProtocolError (2) as per the RFC. See OPENDJ-2813.
          logger.traceException(e);
          continue;
        }
        attrName = attrDesc.getNameOrOID();
        final AttributeType attrType = attrDesc.getAttributeType();
        if (attrType.isPlaceHolder())