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

Re: bug searching for 'attr==+=' (ITS#267)



I have not been able to duplicate this issue.

I added the following entry to slapd running with
tests/data/slapd-master.conf and test.ldif loaded:

dn: cn=bug, o=University of Michigan, c=US
cn: bug
sn: =+=
description: test =+= for *=+= =+=* and *=+=*
objectclass: person
objectclass: top

I used 'sn' instead of 'badsearch' so as not to violate schema rules.

I then issued:

ldapsearch -L -p 9009 -b "o=University of Michigan, c=US" 'sn==+='
ldapsearch -L -p 9009 -b "o=University of Michigan, c=US" 'sn=*=+='
ldapsearch -L -p 9009 -b "o=University of Michigan, c=US" 'sn==+=*'
ldapsearch -L -p 9009 -b "o=University of Michigan, c=US" 'sn=*=+=*'
ldapsearch -L -p 9009 -b "o=University of Michigan, c=US" 'description=*=+=*'

and all returned:

dn: cn=bug, o=University of Michigan, c=US
cn: bug
sn: =+=
description: test =+= for *=+= =+=* and *=+=*
objectclass: person
objectclass: top
creatorsname: cn=Manager, o=University of Michigan, c=US
createtimestamp: 19990822060045Z

as expected.  I then remove the 'sn' index slapd-master.conf,
rebuild the database, and retested with same results.

Are you sure you properly protected the '*' from your command
shell?

	Kurt

At 11:09 PM 8/19/99 GMT, noel@burton-krahn.com wrote:
>Full_Name: Noel Burton-Krahn
>Version: 3.3
>OS: linux-redhat-6.0
>URL: 
>Submission from: (NULL) (209.53.2.147)
>
>#! /bin/sh
># bug-openldap-search-=+=
># Noel Burton-Krahn <noel@burton-krahn.com>
># Aug 19, 1999
># 
># This script reproduces a bug in openldap.  It seems that sometimes
>
>ur base dn>
>LDAP_BIND=<your bind dn>
>LDAP_PASS=<your bind passwd>
>LDAP_PORT=<your ldap port>
>
>ldapadd -p "$LDAP_PORT" -D "$LDAP_BIND" -w "$LDAP_PASS" <<EOF
>dn: cn=noel-bug,$LDAP_BASE
>cn: noel-bug
>sn: bug
>badsearch: =+=
>description: A bug in openldap's wildcard search?
>description: If you search for 'badsearch==+=', you should get this record.
>description: However, if you search for 'badsearch=*=+=', 'badsearch=*=+=*',
>description: or 'badsearch==+=*', you won't.  It seems that wildcards and 
>desctiption: the string '=+=' don't mix.
>description: Note: A search for 'description=*=+=*' works.  Why?
>EOF
>
>echo "this works ok"
>ldapsearch -p "$LDAP_PORT" -b "$LDAP_BASE" 'badsearch==+='
>echo
>
>echo "this fails: no results"
>ldapsearch -p "$LDAP_PORT" -b "$LDAP_BASE" 'badsearch=*=+=*'
>echo
>
>echo "this works.  Why?"
>ldapsearch -p "$LDAP_PORT" -b "$LDAP_BASE" 'description=*=+=*'
>echo
>
>ldapdelete -p "$LDAP_PORT" -D "$LDAP_BIND" -w "$LDAP_PASS"
>"cn=noel-bug,$LDAP_BASE"
>
>
>
>