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

Re: newbie question: run time root and schema discovery?




Robert Mundkowsky wrote:
> 
> Hello,
> 
>     I read through a few LDAP rfcs and I was let wondering:
> 
>     How does a client application at run time:
>         Find the root of a server?

In LDAPv3, you do a base search of the root DSE and look for an attribute
named namingContexts.  Something like this (I do not have acceses to a v3
server, so please have mercy):

	ldapsearch -s base -b '' 'objectclass=*'

That dumps the whole root DSE and you will get namingContexts and other
interesting attributes.  OpenLDAP does not implement v3 yet, but provides
the following, non-standard, method exemplified by:

	$ ldapsearch -s base -b cn=config 'objectclass=*'
	CN=CONFIG
	database=ldbm : DC=STLINTER,DC=NET
	database=Referral:
	ldap://ldap.itd.umich.edu

Each database attribute value details the backend type and its base (a
server may serve several 'roots').

>         Find the best way to make a query (discover the indexing schema
> of the server)?

I am not aware of any, standard or otherwise, method to get this.

>         Discover all of the DNs in a server?

Provided you have adequate access rights, do a subtree search for every
base obtained in the first step.  However, there are certain operational
entities (like the root DSE) that are only returned when explicitly asked
for, I don't know if that is important to you.

Julio