You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For operations with add_ctrls=True, l_ldap_result4 mishandles resp_data.
l_ldap_result4() calls LDAPmessage_to_python() to create pmsg
LDAPmessage_to_python() calls LDAPControls_to_List() to convert server controls to a Python list.
LDAPControls_to_List() returns a tuple of (oid: str, critical: bool, ber: bytes).
The Python implementation of result4 uses _bytesify_results(resp_data, with_ctrls=add_ctrls) to convert results. For add_ctrls it use bytesify_result_value to convert resp_data.
bytesify_result_value wrongly assumes that a List[Tuple[str, bool, bytes]] is a list of referrals when it's in fact a triple of control values.
I cannot reproduce the issue and I'm starting to think that my analysis is wrong, too. The pmsg object is a list of two or three elements. The first element is dn (always unicode). The second is a dict of unicode keys. The third element is the control list List[Tuple[str, bool, bytes]].
#147 (comment) may be caused by an old version of pyldap. I don't see how the error could ever occur with more recent versions of python-ldap. On the other hand the bytesification code is complicated and partly hard to understand.
For operations with
add_ctrls=True
,l_ldap_result4
mishandles resp_data.l_ldap_result4()
callsLDAPmessage_to_python()
to createpmsg
LDAPmessage_to_python()
callsLDAPControls_to_List()
to convert server controls to a Python list.LDAPControls_to_List()
returns a tuple of(oid: str, critical: bool, ber: bytes)
.result4
uses_bytesify_results(resp_data, with_ctrls=add_ctrls)
to convert results. Foradd_ctrls
it usebytesify_result_value
to convert resp_data.bytesify_result_value
wrongly assumes that aList[Tuple[str, bool, bytes]]
is a list of referrals when it's in fact a triple of control values.Original reported as #147 (comment)
The text was updated successfully, but these errors were encountered: