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

Re: libldap controls creation




On Aug 22, 2007, at 11:21 AM, Pierangelo Masarati wrote:


Fixed in HEAD
libraries/libldap/ppolicy.c 1.14,1.15
libraries/libldap/controls.c 1.53,1.55

... then I believe that most of the libldap specific control creation is
broken or at least misusing ldap_create_control().

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.


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...

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. 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:-).


-- Kurt



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
---------------------------------------