[PATCH] [Samba4] Map special DNs to CN=Special container

simo idra at samba.org
Thu Jun 15 13:01:43 GMT 2006


On Thu, 2006-06-15 at 14:35 +0200, Martin Kühl wrote:
> This patch adds the `unspecial' module to ldb.  This module maps
> special DNs like "@MODULES" to normal DNs like
> "CN=Modules,CN=Special".

Martin, we made the special entries just as an internal tdb thing, so I
don't think it makes much sense to have them converted into normal
objects again.
I consider this as a sort of exercise.

> This is already superseded by Andrew B.s partition module, but I
> thought it would make a good "my first ldb module".  I am also aware
> that it can't be used (there is no CN=Special naming context, and if a
> backend can't load special DNs, it won't know about this module
> anyway).

You can always specify the module list on open.

> My questions are:
> - Does this module do what I expect it to? (I.e. use the CN=Special
> container for special DNs internally but show them as special DNs in
> search results.)

>From the DN POV it seem ok, but you fail to translate attribute names
that start with the @ which is an invalid symbol for ldap (even for
attribute names IIRC) and was chosen on purpose.

> - Did I step into any obvious pitfalls (talloc related ones, say)?

I do not understand why you used talloc_steal here (unspecial_search()):

  ac->search_req->op.search.base = talloc_steal(ac->search_req, dn);

you should pass ac->search_req to un_remap_special_dn() as the context
so that the dn is allocated from start on the right talloc context.
Same for all other places.

> - I "this" (use callbacks for handling search results, anything else
> in async_wait) how asynchronism is supposed to work?  If I were to
> split a request in two, would I run the first part directly and the
> second one from the following async_wait?

See the password_hash module to see how that works.

Simo.

-- 
Simo Sorce
Samba Team GPL Compliance Officer
email: idra at samba.org
http://samba.org



More information about the samba-technical mailing list