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

Re: Search in unknown tree



Hi,

On Friday 02 May 2003 11:24, Stefano Semeria wrote:
> Thanks for all the support you give me. BUT I really need to know how to do
> a search using my client if I know the address  of the server but not the
> DN of the root of the DIT. I mean if I want to explore an unknown DIT how
> may I perform any search without knowing anything? I mean what parameter
> should I pass to ldap_search_s() as base DN? I know I could discover
> something  if I  could read the info stored in the root of the DIT (as
> namingContexts attribute), but How may I be  able to do so??? PLEASE IT'S

with LDAPv2 servers you are out of luck.

But with LDAPv3 servers they force is with you:
when you query the rootDN if a server the attribute namingContexts
tells you about the branches that this server knows about.
Please note that you have to explcitely ask for it since it is a system 
attribute

So

  ldapsearch -h SERVER -b "" -x -s base namingContexts

should return something like:

  dn:
  namingContexts: c=de
  namingContexts: o=test

This tells you that the SERVER knows about the naming contexts
c=de and o=test.

You can now use either one of these naming context as 
search base for browsing the tree.

Peter

-- 
Peter Marschall
eMail: peter@adpm.de