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

RE: Help me delete an incorrectly modified entry



I'm sure you'll get better answers, but the problem is that
you've set the RDN to a string with commas in it.  The entry
(I think) is still at the same level in the directory that
it was in before (at ou=People,dc=waveset,dc=com), but the
RDN is now "cn=David Crow, ou=People, dc=waveset, dc=com".
So the problem is to let the server know that the whole
string is the RDN.  I believe to do that, you have to escape
the commas in the RDN with the '\'.  So, try passing to ldapdelete

cn=David Crow\, ou=People\, dc=waveset\, dc=com,ou=People,dc=waveset,dc=com

and see what happens.  Good Luck!

> -----Original Message-----
> From: David L. Crow [mailto:crow@OrangeBlood.org]
> Sent: Wednesday, December 06, 2000 8:22 PM
> To: openldap-software@OpenLDAP.org
> Subject: Help me delete an incorrectly modified entry
> 
> 
> I am using OpenLDAP 1.2.9 on RedHat 6.2 from the RedHat rpm 
> openldap-1.2.9-6.
> 
> I was doing an ldapmodify by hand to modify a dn, I did not 
> specify the
> newrdn correctly, and now I am stuck.
> 
> The old dn was "cn=David L. Crow, ou=People, dc=waveset, dc=com" and I
> want the new dn to be "cn=David Crow, ou=People, dc=waveset, 
> dc=com", so
> I did the following:
> 
>     $ ldapmodify -D cn=root,dc=waveset,dc=com -W << EOF
>     > dn: cn=David L. Crow, ou=People, dc=waveset, dc=com
>     > changetype: modrdn
>     > newrdn: cn=David Crow, ou=People, dc=waveset, dc=com
>     > deleteoldrdn: 1
>     > EOF
>     Enter LDAP Password:
>     modifying rdn of entry cn=David L. Crow, ou=People, 
> dc=waveset, dc=com
>     modrdn completed
> 
> Unfortunately, I now know that the newrdn should have been just
> "cn=David Crow".  My LDAP object now looks like (without phone numbers
> and other somewhat sensitive information):
> 
>     cn=David Crow, ou=People, dc=waveset, dc=com, ou=People, 
> dc=waveset, dc=com
>     ou=People
>     givenname=David
>     objectclass=top
>     objectclass=person
>     objectclass=organizationalPerson
>     objectclass=inetorgperson
>     sn=Crow
>     cn=David Crow
> 
> I could not do an ldapdelete or ldapmodify to correct this problem:
> 
>     $ ldapmodify -D cn=root,dc=waveset,dc=com -W << EOF
>     > dn: cn=David Crow, ou=People, dc=waveset, dc=com, 
> ou=People, dc=waveset, dc=com
>     > changetype: modrdn
>     > newrdn: cn=David Crow
>     > deleteoldrdn: 1
>     > EOF
>     Enter LDAP Password:
>     modifying rdn of entry cn=David Crow, ou=People, 
> dc=waveset, dc=com, ou=People, dc=waveset, dc=com
>     ldap_modrdn: Operations error
> 
>     $ ldapdelete -D cn=root,dc=waveset,dc=com -W << EOF
>     > dn: cn=David Crow, ou=People, dc=waveset, dc=com, 
> ou=People, dc=waveset, dc=com
>     > EOF
>     Enter LDAP Password:
>     ldap_delete: No such object
>     ldap_delete: matched: OU=PEOPLE,DC=WAVESET,DC=COM
> 
> So I figured the problem was that there were no objects for 
> the additional
> "ou=People, dc=waveset, dc=com", so I added them and now I 
> get the error:
> 
>     $ ldapdelete -D cn=root,dc=waveset,dc=com -W << EOF
>     > dn: cn=David Crow, ou=People, dc=waveset, dc=com, 
> ou=People, dc=waveset, dc=com
>     > EOF
>     Enter LDAP Password:
>     ldap_delete: No such object
>     ldap_delete: matched: 
> OU=PEOPLE,DC=WAVESET,DC=COM,OU=PEOPLE,DC=WAVESET,DC=COM
> 
> This seems better, but I still cannot delete or re-modify the record.
> Does anyone have any hints or tips as to how to recover from this?
> Hopefully something other than "restore from backup".  We 
> have plenty of
> backups, but I would hate to lose a days modifications to the 
> directory
> data.
> 
> 
> -- 
>  David L. Crow                     Texas!  It's like a
>  crow@OrangeBlood.org              whole other country.
>