Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Net::LDAP Search Filter

101 views
Skip to first unread message

Zachary, Carlton - Hoboken

unread,
Apr 25, 2013, 9:26:53 AM4/25/13
to perl...@perl.org
Hello all,

I am trying to run this search against my directory service with the following filter and it returns nothing.

(&(employeetype=x)(employeetype=y)(objectclass=*))

But if I do just:

(&(employeetype=x)(objectclass=*))

Or

(&(employeetype=y)(objectclass=*))

I get search data returned.

Could some point out what's wrong with the first filter?

Thanks

david.su...@telefonica.es

unread,
Apr 25, 2013, 9:35:11 AM4/25/13
to perl...@perl.org
Hi there, Carlton,

The problem is that you are asking for employee types x and y, and
assuming they cannot be of more than one type, this means the search will
always be false.

I am sure you are looking for entries of any type of objetclass and
employee type x OR y: (& (objectclass=*) (| (employeetype=x)
(employeetype=y) ) )

This should do the work... You can probably also omit the objectclass part
if the entries are nomal entries (no gruoups, roles or anything weird) and
simply ask for (| (employeetype=x) (employeetype=y)

Good luck!
dwd
_____________________________________________________________________
Mensaje analizado y protegido por Telefonica Grandes Clientes


Zachary, Carlton - Hoboken

unread,
Apr 25, 2013, 10:02:48 AM4/25/13
to Graham Barr, perl...@perl.org
Thanks Graham.

-----Original Message-----
From: Graham Barr [mailto:gb...@pobox.com]
Sent: Thursday, April 25, 2013 9:31 AM
To: Zachary, Carlton - Hoboken
Cc: perl...@perl.org
Subject: Re: Net::LDAP Search Filter


On Apr 25, 2013, at 08:26 , "Zachary, Carlton - Hoboken" <czac...@wiley.com> wrote:

> Hello all,
>
> I am trying to run this search against my directory service with the following filter and it returns nothing.
>
> (&(employeetype=x)(employeetype=y)(objectclass=*))

that is checking

(employeetype=x) and (employeetype=y) and (objectclass=*)

of course

(employeetype=x) and (employeetype=y)

is always going to return an empty list unless x=y

maybe you wanted

(&(|(employeetype=x)(employeetype=y))(objectclass=*))

to get employees of type x or type y

Graham.



Zachary, Carlton - Hoboken

unread,
Apr 25, 2013, 10:03:02 AM4/25/13
to david.su...@telefonica.es, perl...@perl.org
Thanks David.

-----Original Message-----
From: david.su...@telefonica.es [mailto:david.su...@telefonica.es]
Sent: Thursday, April 25, 2013 9:35 AM
To: perl...@perl.org
Subject: Re: Net::LDAP Search Filter

Chris Ridd

unread,
Apr 26, 2013, 3:15:30 AM4/26/13
to Zachary, Carlton - Hoboken, david.su...@telefonica.es, perl...@perl.org

On 25 Apr 2013, at 15:03, "Zachary, Carlton - Hoboken" <czac...@wiley.com> wrote:

> Thanks David.
>
> -----Original Message-----
> From: david.su...@telefonica.es [mailto:david.su...@telefonica.es]
> Sent: Thursday, April 25, 2013 9:35 AM
> To: perl...@perl.org
> Subject: Re: Net::LDAP Search Filter
>
> Hi there, Carlton,
>
> The problem is that you are asking for employee types x and y, and assuming they cannot be of more than one type, this means the search will always be false.

RFC 2798 [inetOrgPerson] defines employeeType as a multi-valued attribute, so both filter items could potentially match the same entry. The AND will require the entry to contain both values, which might also be correct.

This sounds like an issue in the LDAP server. [Rushes off to check what ours does... :-)]

Chris
0 new messages