[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (ITS#5172) slash in dn



Pierangelo,

First of all: Sorry, I've left in fact a paragraph in my .ldif example
that should have come out.

I can reproduce what you've said and using the following code:

#include <ldap.h>
#include <stdio.h>

int main() {
   char **c = ldap_explode_dn(
         "cn=With/Slash,ou=My address book,dc=somedomain,dc=org",
         1);

   int i;
   for (i = 0; c[i] != 0; i++) {
      printf("%s\n", c[i]);
   }

   return 0;
}

which correctly produces:

cn=With/Slash
ou=My address book
dc=somedomain
dc=org

And executing:

# slapdn "cn=With/Slash,ou=My address book,dc=somedomain,dc=org"

produces the expected:

DN: <cn=With/Slash,ou=My address book,dc=somedomain,dc=org> check succeeded
normalized: <cn=with/slash,ou=my address book,dc=somedomain,dc=org>
pretty:     <cn=With/Slash,ou=My address book,dc=somedomain,dc=org>

However, running the actual example produces the following full output:

$ ldapadd -x -D 'cn=root,dc=somedomain,dc=org' -W -f test.ldif
Enter LDAP Password:
adding new entry "dc=somedomain,dc=org"

adding new entry "ou=My address book,dc=somedomain,dc=org"

adding new entry "cn=With/Slash,ou=My address book,dc=somedomain,dc=org"
ldap_add: No such object (32)
        additional info: Parent does not exist

which is erroneous.

Just to check that it is the forward slash that must be to blame, here's
the full output of the counter check:

$ ldapadd -x -D 'cn=root,dc=somedomain,dc=org' -W -f test2.ldif
Enter LDAP Password:
adding new entry "dc=somedomain,dc=org"

adding new entry "ou=My address book,dc=somedomain,dc=org"

adding new entry "cn=WithoutSlash,ou=My address book,dc=somedomain,dc=org"

So, I still suspect a bug...

Reinhold