Mapping ObjectClass in searches

Martin Kühl martin.kuehl at gmail.com
Mon Aug 14 18:15:05 GMT 2006


On 8/14/06, Martin Kühl <mkhl at samba.org> wrote:
> On 8/14/06, Andrew Bartlett <abartlet at samba.org> 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
> tests.
>
> > 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).

The attached patch contains a test-case that proves that objectClasses
are used in searches.  It fails to fail when the above logic fix isn't
applied though, as the remote db is enumerated and the correct results
filtered in that case.

We really should test whether this enumeration happends in the right
situations...

Cheers,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: samba3sam-objectClass.patch
Type: text/x-patch
Size: 1392 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20060814/f4676b29/samba3sam-objectClass.bin


More information about the samba-technical mailing list