svn commit: samba r13278 - in branches/SAMBA_4_0/source/lib/ldb/common: .

simo idra at samba.org
Fri Feb 3 21:50:51 GMT 2006


On Sat, 2006-02-04 at 08:37 +1100, tridge at samba.org wrote:
> Simo,
> 
>  > Replying myself and reconnecting to the topic of attribute name
>  > restrictions. By adopting rfc2251 restriction on attribute names we
>  > solve most of this problem, as we can simply use strcasecmp() as the
>  > only valid chars in an attribute name are ascii7 limited letters,
>  > digitis and hyphens. And the name cannot start with a digit.
> 
> ahh, yes, thats excellent. Your last post had me stumped, as I could
> see that having to propogate the ldb_context everywhere would be a
> real pain. I was trying to think of a way around it, and had come up
> with some pretty ugly alternatives, none of them as appealing as your
> solution!

Yeah it was much easier to do it this way.

> So, this leaves us with only the comparison of values that should be
> interpreted as caseless UTF8 strings, which is really common. That's
> easy though as we already have the ldb_attrib_handler logic, which
> allows us to pass in external comparison functions. So we should pass
> in replacements for ldb_comparison_fold() and ldb_handler_fold() from
> the main Samba code, thus giving us correct multi-language case
> handling in ldb.
> 
> We can do this in one of two ways:
> 
>  1) modify lib/ldb/samba/ldif_handlers.c to register functions for
>     those syntaxes that need it
> 
>  2) add a ldb_set_caseless_cmp() function like I suggested previously,
>     but only use it in common/attrib_handlers.c, and default to
>     strcasecmp()

I used a variant of n.2 caseless_cmp is used in very few places and all
of them have an ldb context handy.
The code is ready and make test work for ldb, have to chase down some
problem caused by the enforcing of the name policy in the samba4 code.

When make test passes I will commit it.

Simo.

-- 
Simo Sorce
Samba Team
email: idra at samba.org
http://samba.org/~idra



More information about the samba-technical mailing list