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

Re: ldapsearch with -s "one" works where -s "sub" fails (ITS#378)

jens@consol.de writes:

> Full_Name: Jens Heunemann
> Version: 1.2.7
> OS: Linux 2.2.5
> URL: 
> Submission from: (NULL) (
> Hi, I ran into the following problem:
> I inserted an entry into an ldap-Database with a perlscript. When I try to
> search for
> the entry, the following strange behavior occurs:
> 1.
> If I search with:
> #  bin/ldapsearch -b "ou=N.N., c=Australia, o=opcos" -s sub "sn=Test"
> I get no results.
> 2.
> If I search with:
> #  bin/ldapsearch -b "ou=N.N., c=Australia, o=opcos" -s one "sn=Test"
> I get the entry I'm searching for:

Your indexes are hosed, id2children seems alright, but the dn index is
broken.  I suggest you stop slapd, do ldbmcat, remove the files in the
database and do a ldif2ldbm on the output from ldbmcat.  With 1.2.7,
don't do it with older versions.

> ------
> cn=Jens Test, ou=N.N., c=Australia, o=OPCOs
> < attributes snipped >
> ----------
> If I search with the filter sn=*, in both (!) cases the second person which is
> located
> under this basedn is found:

This is because sn=* in your case seems to be ALLIDS (a special mark
that says it is useless to list the specific entries that have a sn
since there are so many).  Thus, slapd scans all entries anyway and
discards those that should not be returned.  The selection logic is
independent from idexing and so it works despite your index problems.

Everything seems coherent with hosed indexes, so I would kill that
possibility first.