Mapping ObjectClass in searches

Martin Kühl mkhl at
Mon Aug 14 16:06:10 GMT 2006

On 8/14/06, Andrew Bartlett <abartlet at> wrote:
> Martin:
> In using ldb_map, I ran across some very odd behaviours when we search
> for objectClass=xyz.  The code has been warning at me 'no
> covert_operator set', and indeed this is the case.  (It then proceeds to
> strip this as a search expression, with less than perfect results...)

The problem is that generate mappings are free to do almost anything
to mapped messages, which is why the module doesn't try to guess their
effect on parse trees.
So either we require a convert_operator to search for generate
attributes, even for relatively simple mappings like the objectClass
one with the extensibleObject hack, or we create a mapping type in
between convert and generate that has complete control over a single
message element and extend parse tree handling to those mappings.

> In the patch attached, I have implemented a convert_operator for
> objectClass, by pretending it is a simple MAP_CONVERT operator for the
> search requests.

Nice solution. :-)

> I also have changed the logic for when we should bail out.  I can only
> see reason to bail out on the search if we have both local and remote
> trees.  How can a remote-only search be un-splittable?

Yeah, I seem to have got that mixed up...
I think you should commit that patch, if only for this fix and having
*some* convert_operator for objectClasses.
If you want to wait for a test-case, I'd ask you to still commit this
fix -- enumerating the remote db doesn't play nicely with search

> What I don't have is test-cases.  How do I run the ldb_map tests, and
> can you write one up for this case?

Currently, you run
> smbscript ../testprogs/ejs/samba3sam
but with the attached patch they are run as part of test_ejs.
I expect to have a test-case for the objectClasses later this evening,
and I'd like to add some more later on (split parse trees mainly).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-test.patch
Type: text/x-patch
Size: 15141 bytes
Desc: not available
Url :

More information about the samba-technical mailing list