Uploaded image for project: 'Directory Client API'
  1. Directory Client API
  2. DIRAPI-255

An escaped space at the end of a RDN will not be kept due to a bug in the ComplexDNParser

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.0-M31
    • Fix Version/s: 1.0.0-M32
    • Labels:
      None

      Description

      When we try to parse a DN like "cn=
      a b c
      "
      , the ComplexDnParser will remove the last space due to this code :

      attributeTypeAndValue [Rdn rdn] returns [String upName = ""]
          {
              matchedProduction( "attributeTypeAndValue()" );
              String type = null;
              UpAndNormValue value = new UpAndNormValue();
              String upValue = null;
          }
          :
          (
              ( SPACE { upName += " "; } )*
              type = attributeType { upName += type; }
              ( SPACE { upName += " "; } )*
              EQUALS { upName += "="; }
              ( SPACE 
              { 
                  upName += " "; 
                  
                  if ( upValue == null )
                  {
                      upValue = " ";
                  }
                  else
                  {
                      upValue += " "; 
                  } 
              } )*
              attributeValue[value] 
              {
                  try
                  {
                      if ( value.value instanceof String )
                      {
                          Object unescapedValue = Rdn.unescapeValue( Strings.trim( (String)value.rawValue ) );
      ...
      

      Here, the trim method will remove the last space, no matter if there is a backslash before

        Activity

        Show
        elecharny Emmanuel Lecharny added a comment - Fixed with http://svn.apache.org/viewvc?rev=1708486&view=rev

          People

          • Assignee:
            Unassigned
            Reporter:
            elecharny Emmanuel Lecharny
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development