Bug 49666 - Fix response of serverctrls in univention.admin.uldap.access.search(response={})
Fix response of serverctrls in univention.admin.uldap.access.search(response={})
Status: NEW
Product: UCS
Classification: Unclassified
Component: UDM (Generic)
UCS 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UMC maintainers
UMC maintainers
Depends on: 49638
  Show dependency treegraph
Reported: 2019-06-17 12:19 CEST by Florian Best
Modified: 2019-11-26 16:41 CET (History)
3 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2019-06-17 12:19:55 CEST
Since Bug #49638 lookup() supports adding serverctrls.
But univention.admin.uldap.access.search() doesn't evaluate the response parameter. Therefore it's not possible to get the response of the server controls.

Because ldap.ldapobject.ReconnectLDAPObject doesn't overwrites search_ext() to add the reconnect handling, it has been reverted partially.

Draft for a working way would be something like:

def __search(self, *args, **kwargs):
    response = kwargs.pop('response', None)
    if self.reconnect:
        self.lo._apply_method_s(ldap.ldapobject.SimpleLDAPObject.result3, self.lo._apply_method_s(ldap.ldapobject.SimpleLDAPObject.search_ext, *args, **kwargs))
        rtype, rdata, rmsgid, resp_ctrls = self.lo.result3(self.lo.search_ext(*args, **kwargs))

    if kwargs.get('serverctrls') and isinstance(response, dict):
        response['ctrls'] = resp_ctrls
    return rdata

+++ This bug was initially created as a clone of Bug #49638 +++

The UDM handlers lookup() method should support additional optional parameters to allow passing ldap-controls.
This allows e.g. to use the page control in a lookup() call.
Comment 1 Florian Best univentionstaff 2019-11-26 16:41:35 CET
Current state is in git:fbest/49666-udm-pagination.