ldb controls patches

tridge at samba.org tridge at samba.org
Wed Feb 9 18:28:14 MST 2011


Hi Matthieu,

Andrew and I did a bit more of a review of your ldb_controls changes
today. I think the idea is good, but it needs a bit more work on the
implementation.

The new ldb_controls_to_strings() function returns an array of strings
that is sized as 2*num_controls. That is a fairly strange C interface,
especially for a public function, and we think it is a bit too error
prone. In fact, it looks like your implementation actually gets it
wrong - you mixup 'i' and 'size' in a couple of places and end up not
allocating the right size. (eg. look at where you compare 'i' with
'size-1', where there needs to be a *2 factor included in the
comparison).

How about implementing this function in the python layer instead? We
should have enough accessors to do this, or do you have a need for
this in a C somewhere else?

Maybe a ldb_control class in python, would be worthwhile? Then return
a list of those. The ldb_control class would have a __str__ method, so
you can form it as a nice string if you like.

Cheers, Tridge


More information about the samba-technical mailing list