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:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z 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:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z # ^^ that is one line in the file $ ldapdelete -ZZWx -vf ldap_delete.ldif ldap_initialize( <DEFAULT> ) Enter LDAP Password: deleting entry "dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z" 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?
Thanks in advance!
Daniel
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:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z 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:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z # ^^ that is one line in the file $ ldapdelete -ZZWx -vf ldap_delete.ldif ldap_initialize( <DEFAULT> ) Enter LDAP Password: deleting entry "dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z" 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.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
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
LÉVAI Dániel wrote:
$ 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?
According to the ldapdelete(1) man page, ldapdelete takes the DN to be deleted as an argument. So you cannot put a "dn:" prefix, and thus not even a "dn::" prefix. You need to use ldapmodify(1), which takes LDIF as input (RFC 2849). In that case, your file needs to contain
<snip> dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWV sbCxjbj1hZGRyZXNzYm9va3MsZGM9ZWNlbnRydW0sZGM9aHU= changetype: delete </snip>
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it ----------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Fax: +39 0382 476497 Email: ando@sys-net.it -----------------------------------
On Tuesday 07 October 2008 17.55.30 Pierangelo Masarati wrote:
LÉVAI Dániel wrote:
$ ldapdelete -ZZWx -vf ldap_delete.ldif ldap_initialize( <DEFAULT> ) Enter LDAP Password: deleting entry "dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3M sZGM9ZWNlbnRydW0sZGM9aHU=" ldap_delete: Invalid DN syntax (34) additional info: invalid DN
I think I'm missing something? What could be wrong?
According to the ldapdelete(1) man page, ldapdelete takes the DN to be deleted as an argument. So you cannot put a "dn:" prefix, and
[...] and On Tuesday 07 October 2008 17.58.20 Hallvard B Furuseth wrote:
Whoops... forgot that ldapdelete just takes a list of DNs, not an LDIF file. See the manpage.
[...]
Indeed.. Thanks to both of you. I don't know what would I do w/o the community :)
Daniel
Whoops... forgot that ldapdelete just takes a list of DNs, not an LDIF file. See the manpage.
You could remove the "dn::" part, base64-decode the DN and put that on a separate line. Or you could use ldapmodify instead, with input
dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9ZWNlbnRydW0sZGM9aHU=" changetype: delete
LÉVAI Dániel writes:
dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z WNlbnRydW0sZGM9aHU=
Note the line wrapping. An LDIF line starting with space is a contiunation of the previous line. So it should be:
$ cat ldap_delete.ldif
dn:: Y249w5x6ZW1lbHRldMO1IEJyaWfDoWQsY249ZGFuaWVsbCxjbj1hZGRyZXNzYm9va3MsZGM9Z WNlbnRydW0sZGM9aHU=
I've tried it without the dn:: prefix too, but it didn't work.
Indeed. '::' means your client showed the value in base64 format. It did this because there are 8-bit (non-ASCII) characters in the DN.
openldap-software@openldap.org