I am not clear on your question of limiting. Do you want to limit to the base DN, or the number of searches returned or I assuming you mean the search filter, see below.
Set your search base dn and for further rules on your search filter you can use the following conditions;
& and operator
! Not operator
| or operator
You can combine these for your search i.e. (|(val)(val)) or (&(val)(val)) etc....
From: Saxa Egea [mailto:email@example.com]
Sent: 10 September 2004 12:05
To: Dhiren Pankhania
Subject: Re: Extended attrs search
yeah! This is exactly what I'm looking for.
I couldn't do it. I know that I can type "-b ou=Systems,ou=it,..."
but I need to write this because qmail (and also a lot of services) only let you type a "basedn" and all queries are recursive. This is why I need to limit the results of my query through the filter.
Dhiren Pankhania wrote:
> Are you trying to search under
> ou=systems,ou=it,ou=central,o=enterprise,c=es ?
> If yes, use the switch on ldapsearch -b (for base) and put in the
> above DN. Take out the & as these are conditions on what you are
> searching, but keep the objectclass you want the search to return.
> You can do ldapsearch -? It lists your options.
> -----Original Message-----
> From: Saxa Egea [mailto:firstname.lastname@example.org]
> Sent: 10 September 2004 11:36
> To: OpenLDAP-software@OpenLDAP.org
> Subject: Extended attrs search
> Hi all!
> I have compiled OpenLDAP 2.2.15 and compiled with:
> ./configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/sbin
> --enable-wrappers --enable-aclgroups --enable-spasswd --enable-dynamic
> --enable-shared --with-tls --with-cyrus-sasl --enable-aci
> --enable-ldbm --enable-rewrite --enable-meta --enable-ldap
> --enable-monitor --enable-crypt -q
> All seems ok.
> But I have a problem search with extended attributes.
> My Basedn is o=Enterprise,c=ES
> ldapsearch -x -h ideafix -D cn=Manager,o=Enterprise,c=ES -w password
> It should return 16 entries but nothing is reported. No error reports also.
> I need something else when compiling openldap?
> I make the same query to a backup openldap server (replica) running
> openldap 2.1.20 and it returns 16 accouns (as I expect!)...
> I Need help... Running slapd in verbose mode doesn't report errors.
> Tx a lot!