Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6955770

JNDI tutorial error on Handling Special Characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 7
    • 7
    • docs
    • None
    • b136
    • generic
    • generic
    • Verified

      There are errors on http://java.sun.com/products/jndi/tutorial/beyond/names/syntax.html. Not all \ should be escaped.

      According to javadoc of CompositeName [1]:

       The JNDI syntax defines the following meta characters:

         * escape (backward slash \),
         * quote characters (single (') and double quotes (")), and
         * component separator (forward slash character (/)).

       Any occurrence of a leading quote, an escape preceding any meta
                                          ****************************
       character, an escape at the end of a component, or a component
       *********
       separator character in an unquoted component must be preceded by
       an escape character when that component is being composed into a
       composite name string.

      This means a CN attr of backslash\a should have LDAP name cn=backslash\\a, but its JNDI name should be cn=backslash\\\a. Only the escape itself (the first \) is to be escaped again. The second \, which is in the original content, is not an escape.

      [1] http://java.sun.com/javase/6/docs/api/javax/naming/CompositeName.html

            sharonz Sharon Zakhour (Inactive)
            weijun Weijun Wang
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: