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

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



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"