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

Re: cannot delete an entry !?



Jehan PROCACCIA wrote:

> I entered a wrong entry, how ? no matter , now I want to remove it  but
> I cannot  :-(.
>
> $ldapsearch -x -b "dc=int-evry,dc=fr" "uid=*toto*"
> version: 2
>
> #
> # filter: uid=*toto*
> # requesting: ALL
> #
>
> # toto,People,dc=int-evry,dc=fr,People,dc=int-evry,dc=fr
> dn: uid=toto,ou=People,dc=int-evry,dc=fr,ou=People,dc=int-evry,dc=fr
> uid: gilles
> uid: toto,ou=People,dc=int-evry,dc=fr
> ...
>
> here the entry is found, but the dn is wrong.
> dn: uid=toto,ou=People,dc=int-evry,dc=fr,ou=People,dc=int-evry,dc=fr
>
> should be
>
> dn: uid=toto,ou=People,dc=int-evry,dc=fr
>
> I just want to remove it , how ?
>
> $cat /tmp/dn
> dn: uid=toto\,ou=People\,dc=int-evry\,dc=fr,ou=People,dc=int-evry,dc=fr
> changetype: delete
>
> $ldapmodify -x -W -D"cn=admin,dc=int-evry,dc=fr" -f /tmp/dn
> Enter LDAP Password:
> deleting entry
> "uid=toto,ou=People,dc=int-evry,dc=fr,ou=People,dc=int-evry,dc=fr"
> ldap_delete: Unknown error
>         additional info: could not locate parent of entry
>
> ldif_record() = 80

Looks like you played a little with modrdn, right?
Next release of OpenLDAP will not allow this any
more. Back to your problem, there's no way to delete
that entry by means of a normal delete operation.
All you should do, in my opinion, is dump the database
and start from scratch with slapadd, after cleaning
by hand the ldif file.

Pierangelo.


--
Dr. Pierangelo Masarati               | voice: +39 02 2399 8309
Dip. Ing. Aerospaziale                | fax:   +39 02 2399 8334
Politecnico di Milano                 | mailto:masarati@aero.polimi.it
via La Masa 34, 20156 Milano, Italy   | http://www.aero.polimi.it/~masarati