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

RE: Searching on dn; please send clue



The DN isn't an attribute.  You can't search on it like you
would an attribute.  If you know the DN you want, use it as
the base of the search and set the scope to base, and use
objectclass=* as a filter.

ldapsearch -b "uid=foo,ou=People,dc=mycompany,dc=com" -s base objectclass=*

> -----Original Message-----
> From: Karl O. Pinc [mailto:kpinc@artic.edu]
> Sent: Friday, December 15, 2000 12:30 PM
> To: openldap-software@OpenLDAP.org
> Subject: Searching on dn; please send clue
> 
> 
> I must be missing a fundimental.  What is the syntax for filtering on
> distinguished name?
> 
> This works: ldapsearch uid=foo
> 
> (returns the uid=foo,ou=People,dc=mycompany,dc=com entry)
> 
> These don't:
> ldapsearch uid=foo,ou=People,dc=mycompany,dc=com
> ldapsearch dn="uid=foo,ou=People,dc=mycompany,dc=com"
> 
> Maybe my config is not right?  I've gone back to no "access" 
> directives and
> "defaultaccess  read" just to make sure it's not in the 
> access control.
> 
> (I can bind as this user.)
> 
> openldap version 1.2.11 (rpm release 15)
> Linux 2.2.17
> Redhat 6.2
> 
> Any help at all would be appreicated.  Thanks.
> 
> Karl
> 
> May the Legos (TM) always be swept from your path in the night.
> 
>