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

Character escaping does not work properly (ITS#247)



Full_Name: Andre Oppermann
Version: 1.20
OS: FreeBSD 3.2-STABLE
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (62.48.0.53)


Problem:

 I have LDAP records that contain asterisks ('*') and I want to match on them,
 means not use them as wildcarts. The relevant RFC's say I have to simply
escape
 the char with '\' (RFS1559) or use the escape/hex notion '\2A' (RFC2254).
 Both do not give the desired and anticipated result, see examples.

Search according to RFC1559:

#ldapsearch -h localhost -b "o=Internet Pipeline, c=CH" -v
"(mail=\*@pipeline.ch)" mail

  ldap_init( localhost, 0 )
  filter pattern: (mail=\*@pipeline.ch)
  returning: mail
  filter is: ((mail=\*@pipeline.ch))
  cn=IBS / Andre Oppermann, o=Internet Pipeline, c=CH
  mail=andre@pipeline.ch

  cn=Catch All, o=Internet Pipeline, c=CH
  mail=*@pipeline.ch
  2 matches

Search according to RFC2254:

#ldapsearch -h localhost -b "o=Internet Pipeline, c=CH" -v
"(mail=\2a@pipeline.ch)" mail

  ldap_init( localhost, 0 )
  filter pattern: (mail=\2a@pipeline.ch)
  returning: mail
  filter is: ((mail=\2a@pipeline.ch))
  0 matches


My source record in LDIF format:

 dn: cn=Catch All, o=Internet Pipeline, c=CH
 objectclass: top
 objectclass: person
 objectclass: organizationalPerson
 objectclass: inetOrgPerson
 objectclass: mailRecipient
 cn: Catch All
 sn: All
 mail: *@pipeline.ch
 userpassword: {SHA}/Uzvek5gfx/MkgrWMppt8t+ZpOg=
 mailhost: mailtoaster1.pipeline.ch
 uid: catchall
 mailMessagestore: part1/test/catchall/