[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: libldap controls creation



Kurt Zeilenga wrote:

> Well, ldap_create_control is flawed, period, as its not generally
> usable.  It only applicable to controls whose values are BER encoded
> using our BER library.  Seems more appropriate that those using our BER
> library to generate BER encoded data for a control value ought to do all
> the BER calls themselves. I recommend axing it, or at least, deprecating
> it from the API.

OK.

> I'd also recommend deprecating ldap_find_control promotes running
> through the sequence of controls multiple times... and it cannot find
> the 2nd or later control of the same kind...

OK.

>> See for example pagectrl.c, sortctrl.c and more.
> 
> The paged and sorted request controls, IIRC, always have control values
> containing BER encoded data.  So ldap_create_control(3) should not be
> broken here.

It's not broken, it's rather used in a broken manner: called with a NULL
ber, with the control value separately cooked and set afterwards...

> The ppolicy request control must not have a control value,
> so that use was broken.  Hence the change.  Time is short for me at the
> moment, so just made a quick fix (a bit too quick, as you can see from
> the commit log:-).

:)

I'll try to cleanup things a little bit.

p.



Ing. Pierangelo Masarati
OpenLDAP Core Team

SysNet s.r.l.
via Dossi, 8 - 27100 Pavia - ITALIA
http://www.sys-net.it
---------------------------------------
Office:  +39 02 23998309
Mobile:  +39 333 4963172
Email:   pierangelo.masarati@sys-net.it
---------------------------------------