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

sin
10.11.2009 4efdec101fe7fe745e2736358e31b8780760b787
issue# 3445: Normalization of multi-valued RDNs
3 files modified
33 ■■■■■ changed files
opends/src/messages/messages/schema.properties 7 ●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/types/DN.java 22 ●●●●● patch | view | raw | blame | history
opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestDN.java 4 ●●● patch | view | raw | blame | history
opends/src/messages/messages/schema.properties
@@ -20,7 +20,7 @@
#
# CDDL HEADER END
#
#      Copyright 2006-2008 Sun Microsystems, Inc.
#      Copyright 2006-2009 Sun Microsystems, Inc.
@@ -916,4 +916,7 @@
 rule %s under matching rule entry %s is invalid as the locale %s is not supported \
 by JVM
MILD_WARN_ATTR_INVALID_COLLATION_MATCHING_RULE_FORMAT_281=The provided \
 collation rule %s does not contain a valid format of OID:LOCALE
 collation rule %s does not contain a valid format of OID:LOCALE
MILD_ERR_ATTR_SYNTAX_DN_INVALID_REQUIRES_ESCAPE_CHAR_282=The provided \
 value "%s" could not be parsed as a valid distinguished name because an \
 attribute value started with a character at position %d that needs to be escaped
opends/src/server/org/opends/server/types/DN.java
@@ -2220,6 +2220,17 @@
      return bs;
    }
    else if(b == '+' || b == ',')
    {
      //We don't allow an empty attribute value. So do not allow the
      // first character to be a '+' or ',' since it is not escaped
      // by the user.
      Message message =
             ERR_ATTR_SYNTAX_DN_INVALID_REQUIRES_ESCAPE_CHAR.get(
                      dnBytes.toString(),dnBytes.position());
          throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                                       message);
    }
    // Otherwise, use general parsing to find the end of the value.
    else
@@ -2448,6 +2459,17 @@
      attributeValue.append(valueString.toString());
      return pos;
    }
    else if(c == '+' || c == ',')
    {
      //We don't allow an empty attribute value. So do not allow the
      // first character to be a '+' or ',' since it is not escaped
      // by the user.
      Message message =
             ERR_ATTR_SYNTAX_DN_INVALID_REQUIRES_ESCAPE_CHAR.get(
                      dnString,pos);
          throw new DirectoryException(ResultCode.INVALID_DN_SYNTAX,
                                       message);
    }
    // Otherwise, use general parsing to find the end of the value.
opends/tests/unit-tests-testng/src/server/org/opends/server/types/TestDN.java
@@ -147,7 +147,9 @@
        { "\u03c0=pi" },  { "v1.0=buggy" }, { "1.=buggy" }, { ".1=buggy" },
        { "oid.1." }, { "1.3.6.1.4.1.1466..0=#04024869" },
        { "cn=#a" }, { "cn=#ag" }, { "cn=#ga" }, { "cn=#abcdefgh" },
        { "cn=a\\b" }, { "cn=a\\bg" }, { "cn=\"hello" } };
        { "cn=a\\b" }, { "cn=a\\bg" }, { "cn=\"hello" },
        {"cn=+mail=,dc=example,dc=com"},{"cn=xyz+sn=,dc=example,dc=com"},
        {"cn=,dc=example,dc=com"}};
  }