HI!
I'd like to implement the assertion control in python-ldap.
Are there already any utility functions usable for generating the control value? Basically this would be turning a filter string representation into the BER. Yes?
Preferrably in OpenLDAP 2.3.x libs (since 2.3 is currently the minimum requirement for building python-ldap).
Ciao, Michael.
Michael Ströder wrote:
HI!
I'd like to implement the assertion control in python-ldap.
Are there already any utility functions usable for generating the control value? Basically this would be turning a filter string representation into the BER. Yes?
Preferrably in OpenLDAP 2.3.x libs (since 2.3 is currently the minimum requirement for building python-ldap).
AFAIK, there's none. You could easily implement one by moving the code available in clients/tools/common.c into a specific (non-existing yet) libraries/libldap/assertion.c file that implements the control manipulation along the lines already set for other well-known controls; see libraries/libldap/ppolicy.c or similar for guidelines. You ought to create some
int ldap_create_assertion_control(LDAP *ld, LDAPControl **ctrlp, char *filter, int iscritical)
function. Please provide a patch using the ITS (or commit it, if you feel comfortable with it). If you feel uncomfortable, just submit a feature request with the ITS.
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: ando@sys-net.it -----------------------------------
Pierangelo Masarati wrote:
function. Please provide a patch using the ITS (or commit it, if you feel comfortable with it). If you feel uncomfortable, just submit a feature request with the ITS.
I have prepared an implementation of this feature. If you like, I can commit it, unless you're already preparing one. Probably, an ITS with the feature request would be appropriate anyway.
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: ando@sys-net.it -----------------------------------
Pierangelo Masarati wrote:
Pierangelo Masarati wrote:
function. Please provide a patch using the ITS (or commit it, if you feel comfortable with it). If you feel uncomfortable, just submit a feature request with the ITS.
I have prepared an implementation of this feature.
Great.
If you like, I can commit it, unless you're already preparing one.
Since I'm not a C programmer I can't really provide bigger patches.
Probably, an ITS with the feature request would be appropriate anyway.
Filed ITS#5560.
Well, probably for python-ldap I'd just need to use ldap_pvt_put_filter() and ber_flatten2().
Ciao, Michael.
Michael Ströder wrote:
Well, probably for python-ldap I'd just need to use ldap_pvt_put_filter() and ber_flatten2().
yes :) please test HEAD. The functions are ldap_create_assertion_control() ldap_create_assertion_control_value(); Their use is straightforward. The latter is already in use by all tools.
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: ando@sys-net.it -----------------------------------
openldap-software@openldap.org