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

RE: FW: Unable to delete a dn with \\\

> Tony Earnshaw writes:
> > 1: Have you tried escaping each backslash with a forward slash?

> Hallvard B Furuseth writes:
> Eh?  The escape character is backslash.  That's probably why there are
> so many of them in that DN already.

> Keep in mind that backslash is also an escape character in the shell,
> so at least in Bourne-type shells you have to duplicate each
> backslash just so it'll reach the command.  If you need to duplicate
> them in the command as well (which I don't know), you'll have to
> quadruple each backslash:-(

This is progress.  The escape character as Hallvard writes is the 
backslash.  Now if I search using:

ldapsearch -xW -D "cn=qmail-ldap, o=Organisation, c=AU" \
  -b "o=Organisation, c=AU" "cn=O\\\\\\\\\\\'Flaherty Sue"

The response is:

# filter: cn=O\\\\\\'Flaherty Sue
# requesting: ALL

# O\\\'Flaherty Sue, centacare.org, Organisation, AU
dn: cn=O\\\'Flaherty Sue,ou=centacare.org,o=Organisation, c=AU
objectClass: top
objectClass: person
objectClass: qmailuser
cn: O\\\'Flaherty Sue
sn: O\\\'Flaherty Sue
mail: sue.oflaherty@centacare.org
uid: suef
accountStatus: active
mailMessageStore: centacare.org/suef
deliveryMode: localdelivery

# search result
search: 2
result: 0 Success

# numResponses: 2
# numEntries: 1

This is of course the response that I would expect however when I try to
delete the record using:

ldapdelete -xW -D "cn=qmail-ldap, o=Organisation, c=AU" \
  "cn=O\\\\\\\\\\\'Flaherty Sue,ou=centacare.org,o=Organisation, c=AU"

no luck.

However, I did not give up there and after quite a few tries and some 
silly mistakes I got the desired result with:

ldapdelete -xW -D "cn=qmail-ldap, o=Organisation, c=AU" \
  "cn=O\\\\\'Flaherty Sue,ou=centacare.org,o=Organisation, c=AU"

It seems that the escape is not needed on the full dn when deleting
but is however required on the filter when searching.

Thank you, both for your assistance.

Shaun Scott