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

Re: ldapdelete struggle



On Tuesday 07 October 2008 15.38.07 Pierangelo Masarati wrote:
> LÉVAI Dániel wrote:
> > Hi!
> >
> > I'm having this problem with deleting an entry from my ldap
> > database. Here is what I'm doing:
> > # search for the entry
> > $ ldapsearch -ZZWx '(mail=*uzem*)'
> > Enter LDAP Password:
> > [...]
> > dn::
> > Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3M
> >sZGM9Z WNlbnRydW0sZGM9aHU=
> > [...]
> > # numResponses: 2
> > # numEntries: 1
> >
> > # got the dn, it is encoded in base64, so I'm trying to delete it:
> > $ cat ldap_delete.ldif
> > dn::
> > Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3M
> >sZGM9Z # ^^ that is one line in the file
> > $ ldapdelete -ZZWx -vf ldap_delete.ldif
> > ldap_initialize( <DEFAULT> )
> > Enter LDAP Password:
> > deleting entry "dn::
> > Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3M
> >sZGM9Z" ldap_delete: Invalid DN syntax (34)
> >         additional info: invalid DN
> >
> > I've tried it without the dn:: prefix too, but it didn't work.
> >
> > Could someone help me with this?
>
> You're missing the trailing "WNlbnRydW0sZGM9aHU=" portion of your DN.
> Glue together the two halves and retry.
>
Argh... sorry and thanks, didn't notice it...
I've corrected it so it looks like this now:

$ cat ldap_delete.ldif
dn:: \
Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9ZWNlbnRydW0sZGM9aHU=
# the '\' is not there, and this is one line

$ ldapdelete -ZZWx -vf ldap_delete.ldif
ldap_initialize( <DEFAULT> )
Enter LDAP Password:
deleting entry "dn:: 
Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9ZWNlbnRydW0sZGM9aHU="
ldap_delete: Invalid DN syntax (34)
        additional info: invalid DN

I think I'm missing something? What could be wrong?

Daniel

-- 
LEVAI Daniel
PGP key ID = 0x4AC0A4B1
Key fingerprint = D037 03B9 C12D D338 4412  2D83 1373 917A 4AC0 A4B1