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

Re: ldapsearch using dn= as the filter returns no results.

I would suggest ldapguru.com for general ldap
questions.  As for whay your search doesn't work, DN
is not an "attribute" per se.  You can't search on it
the way you can search on uid or cn.  To get all the
attributes of a user for whom you know the DN, you
would perform a base search, ie:

ldapsearch -b uid=user,dc=domain,dc=com -s base

Some directories include a copy of the dn as an
attribute (such as activedirectory), but you can not
include the DN in a search filter.

Marc Boorshtein
--- "Eclipse WebMaster (Denis Roy)"
<webmaster@eclipse.org> wrote:
> Hi,
> After Googling this for about an hour, I decided to
> post here. If I 
> issue the following command:
> $> ldapsearch -x -LLL "uid=droy"
> I get:
> dn: uid=droy,ou=people,dc=eclipse,dc=org
> cn: Denis Roy
> [...]
> However, if I try a search using my DN, I can never
> get a result:
> ldapsearch -x -LLL
> "dn=uid=droy,ou=people,dc=eclipse,dc=org"
> I'm writing a Perl application where I have the
> user's DN, and need 
> their mail address. Unfortunately, perl's
> ldap->search using the DN as a 
> filter behaves the same way.
> Any help or pointers on how to search for entries
> based on the DN would 
> be appreciated!
> Thanks
> -- 
> Eclipse WebMaster - webmaster@eclipse.org
> Questions? Consult the FAQ at
> http://www.eclipse.org/webmaster/faq.html
> View my status at
> http://www.eclipse.org/webmaster/main.html