Issue Details (XML | Word | Printable)

Key: DIRSERVER-696
Type: Bug Bug
Status: Closed Closed
Resolution: Invalid
Priority: Major Major
Assignee: Emmanuel Lecharny
Reporter: Stefan Zoerner
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Directory ApacheDS

Adding entries with RDNs enclosed in quotes may lead to entries with illegal DNs

Created: 04/Aug/06 07:23 PM   Updated: 02/Oct/06 01:12 PM
Return to search
Component/s: None
Affects Version/s: 1.0-RC4
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
File quotesEntries.ldif 2006-08-04 07:29 PM Stefan Zoerner 0.7 kB
Environment:
    * ApacheDS 1.0 RC4 SNAPSHOT
    * Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
    * Windows XP Professional SP2

Resolution Date: 25/Aug/06 08:39 AM


 Description  « Hide
Using ApacheDS 1.0 RC4 SNAPSHOT with server.xml unchanged.

If I try to add something like this

dn: ou="Scissors 8<",dc=example,dc=com
ou: "Scissors 8<"
objectclass: organizationalUnit
objectclass: top

an entry is created like that (quotes missing)

dn: ou=Scissors 8<,dc=example,dc=com
ou: Scissors 8<
objectclass: organizationalUnit
objectclass: top

This causes a lot of trouble in some tools I use (LDAP Administrator, for instance). I checked the behaviour of IBM Tivoli Directory Server 6.0 and Sun Java System Directory Server 5.2. They behave different, but both create entries with valid DNs:

Sun:

dn: ou="Scissors 8<",dc=example,dc=com
ou: "Scissors 8<"
ou: Scissors 8<
objectClass: organizationalUnit
objectClass: top

IBM:

dn: ou=Scissors 8\<,dc=example,dc=com
ou: "Scissors 8<"
ou: Scissors 8<
objectclass: organizationalUnit
objectclass: top

I add an LDIF file with this entry and comparable entries, which cause the same error.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Stefan Zoerner made changes - 04/Aug/06 07:29 PM
Field Original Value New Value
Attachment quotesEntries.ldif [ 12338180 ]
Alex Karasulu made changes - 06/Aug/06 07:26 PM
Assignee Emmanuel Lecharny [ elecharny ]
Stefan Zoerner made changes - 22/Aug/06 03:37 PM
Comment [ I think that the VSLDAP test relationship3_4_0_10 is wrong :
...
String baseObject = "cn=\"Easy Come, Easy Go\",ou=Syntaxes,ou=Search,o=IMC,c=US";
String filter = "(cn=\"Easy Come, Easy Go\")";

SearchRequest Request = new SearchRequest( baseObject, filter );
Request.scope = Scope.baseObject;

try{
Response = ldap.search( Request );

// Should return "Easy Come, Easy Go", only.

if( (Response.entries.size() == 1)
&& (Response.objectExists( "cn", "\"Easy Come, Easy Go\"" )) )
{
ts.tet_result( ts.TET_PASS );
return;
}
...

The baseObject escape " with a \, but it should use a \\\". If not, the the RDN should be equals to :
cn=\"Easy Come, Easy Go\"
which is equivalent to :
cn=Easy Come\, Easy Go

but as we use " surronding the value, we don't need to escape the ','. But this lead to a problem :
as stated by RFC 2253 :
"Implementations MUST allow a value to be surrounded by quote ('"' ASCII 34) characters, which are not part of the value"

so the way the test is written in java means we should remove the " around the value before storing the value.

We should ask OpenGroup guys about it.
]
Emmanuel Lecharny made changes - 22/Aug/06 04:19 PM
Comment [ This is really strange.
creating an entry like :
dn: ou="Scissors 8<",dc=example,dc=com
ou: "Scissors 8<"
objectclass: organizationalUnit
objectclass: top

should throw an exception.
The DN should only contains values that are declared as attributes.
ou="Scissors 8<" attribute is not the same as ou=Scissors 8<.

In DN, the ou="Scissors 8<" RDN correspond to the attribute type and value :
ou = Scissors 8<
where the " are removed.
if you don't create the very same attribute, then you will get an error.
It's weird that IBM and Sun create this attribute (tgis is the reason why we can see both values in the SUN and IBM results when you do a search.

Can we have more info on the real problem in VSLDAP with this escaped values ? ]
Emmanuel Lecharny made changes - 25/Aug/06 08:39 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Invalid [ 6 ]
Stefan Zoerner made changes - 02/Oct/06 01:12 PM
Status Resolved [ 5 ] Closed [ 6 ]