masarati@aero.polimi.it wrote:
Disclaimer: I'm not a C programmer.
I'd like to evaluate response controls (e.g. ppolicy) also when doing a SASL bind. I'm using python-ldap which in turn uses OpenLDAP C API's function ldap_sasl_interactive_bind_s().
Not sure about that. In clients/tools/common.c there is an example of using ldap_sasl_interactive_bind() asynchronously that purposely allows to extract controls information from the (last) response
I'm staring at line 1473 in clients/tools/common.c of RE24 but I simply don't get it: IMHO in opposite to later call of ldap_sasl_bind() (in a separate else clause starting at line 1490) a msgid is not returned by the API and therefore it seems to me that ldap_result() is not and cannot be called in the SASL part.
But as said numerous times: I'm quite ignorant regarding C and I might overlook something.
Not sure about how this could be integrated in python-ldap; my suggestion, without looking at the code, would be to add/modify python-ldap's call to ldap_sasl_interactive_bind_s() to optionally give access to all results (resultCode, diagnostics, controls).
I'd happily do but I'm not sure how...
You can see the call in line 674 here:
http://python-ldap.cvs.sourceforge.net/viewvc/python-ldap/python-ldap/Module...
The var name msgid was a misunderstanding taken over from the code submitted by another contributer years ago. Should be called rc or similar instead.
Ciao, Michael.