Skip to content

result4() mistreats operations with add_ctrls=True #149

@tiran

Description

@tiran

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.

Original reported as #147 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions