[Date Prev][Date Next]
Re: getting object by its DN
LDAPSEARCH has a -s (scope) option which defaults to 'subtree'. If you specify
a scope of 'base' you can give a DN and it will return the record.
ldapsearch -h host -b <basedn> -s base "uid=bsmith,o=myorg,c=us"
Quoting Adrian Pavlykevych <email@example.com>:
> Hi everybody!
> Is there any simple ways to get LDAP object by its DN in OpenLDAP SDK?
> ldap_search() doesn't recognize filter like:
> I know, that by splitting DN into cn and rest I can make search using rest
> of DN as base, but is that the only way?
> What is the cannonical approach?
> Thanks in advance,
> Adrian Pavlykevych email: <firstname.lastname@example.org>
> System Administrator phone/fax: +380 (322) 742041
> State University "Lvivska Polytechnica"