[ 
https://issues.apache.org/jira/browse/DIRSERVER-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462857
 ] 

Emmanuel Lecharny commented on DIRSERVER-815:
---------------------------------------------

So far, I think this is because we get the user provided DN to construct the 
matchedDN. In your case, we cut it to just get the wrong part.

As the initial DN contains some spaces, we keep them :
initial DN : cn=Fiona_Apple,_ou=missing,_dc=example,_dc=com
(spaces have been replaced by _ )
now, the cut part is : _ou=missing,_dc=example,_dc=com

and we return it as is. Would you have had 10 spaces before ou, you will have 
seen them too.

Ok, then, is this a problem? Spaces are not significant anyway, and I guess a 
client will use an API to deal with DN (because it's damn complicated to parse 
!!!), so do we have to modify the server to suppress those leading spaces ?

> Value of matchedDN keeps leading spaces, if add operation fails due to 
> missing parent entry
> -------------------------------------------------------------------------------------------
>
>                 Key: DIRSERVER-815
>                 URL: https://issues.apache.org/jira/browse/DIRSERVER-815
>             Project: Directory ApacheDS
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>         Environment: * ApacheDS 1.5.0 (SNAPSHOT)
> * Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)
> * Windows XP Professional SP2
>            Reporter: Stefan Zoerner
>            Priority: Minor
>         Attachments: OpsWithMissingParentNetscapeSDK.java
>
>
> If I try to add an entry with DN "cn=Fiona Apple, ou=missing, dc=example, 
> dc=com" (spaces are important), and the parent entry "ou=missing, dc=example, 
> dc=com" does not exist, the operation fails with the correct result code (32: 
> no such object).  
> LDIF-File Fiona.ldif:
> ---8<---
> dn: cn=Fiona Apple, ou=missing, dc=example, dc=com
> objectclass: person
> objectclass: top
> sn: Apple
> cn: Fiona Apple
> --->8---
> $ ldapmodify -h localhost -p 10389 -D "uid=admin,ou=system" -w ******-q -c -a 
> -f Fiona.ldif
> ldap_add: No such object
> ldap_add: matched:  dc=example, dc=com
> ldap_add: additional info: failed to add entry cn=Fiona 
> Apple,ou=missing,dc=example,dc=com: Parent  ou=missing, dc=example, dc=com 
> not found
> But the value of the matchedDN field starts with a blank (it is 
> "_dc=example,_dc=com", '_' denotes a blank). This behavior is present in the 
> current 1.5 SNAPSHOT only. In the 1.0 release, the matchedDN value is 
> "dc=example,_dc=com", which is the expected result.
> Unfortunately I was not able to reproduce this problem with JNDI yet. JNDI 
> seems to modify the matchedDN result in the NameNotFoundException. But with 
> Netscape SDK the problem is reproducible.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to