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

Re: back-sql and filter behavior



Hello Franciszka!


As I could understand, when you are issuing query with objectclass filter,
you receive some result entries and a referral, and when
the filter is empty, you receive all the entries, no referrals... There is
2 things to say then:

1) the first behaviour (returning referral) is right thing, because
ldap_referrals contain a "ref" attribute, and ldap_entry_objectclasses -
an objectclass attrubute with value of "referral" for the entry. This, per
"named referrals" draft implemented in openldap frontend, requires the
return of a referral.
These 2 tables are a default mechanism for storing referral information in
back-sql. Mappings for "objectclass" and "ref" attributes as columns in
those tables are added automatically for every registered objectclass
mapping. So if you want some entry to have additional objectclasses along
with that defined in mapping - add a record with appropriate id to
ldap_entry_objectclasses, and if you want an entry to have the ref
attribute - add a record to ldap_referrals.

2)different behavior with empty filter is probably a bug, but I'm not
shure that empty filter is valid at all... Is it said somewhere in RFCs
that empty filter must be responded to as "objectclass=*" filter? I just
don't know.


WBW, Dmitry


Franciszka Bakowska wrote:

> Can someone explain the following behavior?
>
> ldapsearch with filter '' lists all records as expected,
> but using the filter '(objectclass=*)' returns the search
> referral instead of one of the records.
>
> For example, using the back-sql sample data:
>
>    ldapsearch -h host -b 'o=sql,c=RU' 'objectclass=*'
>
> includes the following (among other results):
>
>    # search reference
>    ref: http://localhost
>
> *instead of* the entry for cn=Akakiy Zinberstein,o=sql,c=RU.
> However, using the empty filter '' returns all of the records expected.
>
> Tables ldap_referrals and ldap_entry_objclasses, both have entries with
> entry_id 4 for this referral, which is the same as the id (4) of the
> Akakiy record in table ldap_entries.  Does the value 4 have any
> particular significance?
>
> Thanks,
>
> Fran