help on subschema

Michael Ströder michael at stroeder.com
Mon Feb 16 10:43:36 CET 2004


paul k wrote:
> Hi all,
> how do I query the servers subschema entry  for supported objectclasses? 

See Demo/schema.py.

> Searching like:
> 
> conn.search_s('cn=subschema',ldap.SCOPE_SUBTREE, '(objectclass=*)')
 > returns ldap.NO_SUCH_OBJECT.

The sub schema sub entry is not always located in cn=subschema. You have to 
query the operational attribute subschemaSubentry for the DN holding the sub 
schema sub entry. That's what ldap.LDAPObject.search_subschemasubentry_s() 
is for.

Note that each part of the DIT can have its own separate sub schema sub 
entry! You have to query subschemaSubentry at each and every DN you're 
working with. Therefore you have to implement some kind of caching of sub 
schema instances to make it efficient.

I know the whole schema stuff is completely undocumented. But have a look at 
Demo/schema.py. That should make things more clear.

Ciao, Michael.



More information about the python-ldap mailing list