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

Re: ldap_search_s question



Shawn,

I not sure if this applies to your situation, but I observed
some similar problems related to indexing and an error
in my ldif files that I used to create the database with ldif2ldbm.
When I would do an ldap search for a specific username, for
example:

ldapsearch -h [host] -b [searchbase] "(uid=tpeterma)"

it would return nothing.  If I did a search using a
wild card, however, such as:

ldapsearch -h [host] -b [searchbase] "(uid=tp*)"

it would return the expected results.

I eventually tracked the problem down to two empty lines
between two entries near the beginning of my ldif file (should
only be one empty line between ldif entries).  Apparently
ldif2ldbm was forgiving enough to create the complete database,
but not complete indexes - I think everything below the 2 blank
lines was not indexed.  So when trying to search for a indexed
attribute nothing was found, but a wild card search, which
scanned the whole database (for my configuration anyway),
worked fine.

Note: My index line in my slapd.conf file looked like this (not
indexing substrings):

index           cn,sn,uid pres,eq,approx

I have since changed it to the following for faster performance
(but larger indexes) when searching using wildcards:

index           cn,sn,uid pres,eq,approx,sub

-- 
Tim Peterman - Unix & Web Server Administration
Lockheed Martin GES/EIS, Moorestown, NJ
mailto:timothy.p.peterman@lmco.com


Shawn Tagseth wrote:
> 
> I think I've narrowed down my problem to the search filter...  Is there
> anything wrong with this search
> 
> ldapsearch -h [host] "(objectclass=bbm_client_org*)"
> 
> If I use a filter like
> (&(organization=bbm*)(objectclass=bbm_client_org*)) I get the correct
> results every time.  As soon as I try to pull up everything in
> bbm_client_org, sometimes the list gets truncated, sometimes I get every
> entry, sometimes.......
> 
> Something else thats a bit odd is if I don't use the * at the end of
> bbm_client_org I get more truncated entries and errors than without
> it.....
> 
> Shawn
> 
> ps happens with RH6.0 and M$.
> 
> -----Original Message-----
> From: Shawn Tagseth [mailto:stagseth@bbm.ca]
> Sent: Tuesday, April 27, 1999 12:40 PM
> To: Openldap-Software (E-mail)
> Subject: ldap_search_s question
> 
> I have a very small test program that basically, ldap_open, ldap_bind,
> ldap_disable_cache (for good luck i guess) and then ldap_search_s,
> ldap_unbind and close.
> 
> If I run the program, I guess depending on sunspots, sometimes (most of
> the time actually) ldap_search_s returns 81 (Can't contact server????)
> and sometimes it returns 0 (Success???) with all 296 records.
> 
> I am not recompiling the program and there seems to be no rhyme or
> reason why I get the error.  Ldap open and bind return positives so I
> assume I'm doing something right (let me think about that one....)
> 
> I'm using using M$ VC6 sp2 on win 98 connecting to a freebsd server.
> All my linux machines are on the other side of the firewall so I can't
> test to see if its just the freaky M$ tcp stack.  This is also my first
> crack at anything to do with LDAP so it could very well be that too.
> 
> Thanks!
> 
> Shawn K. Tagseth