Skip to content

Response controls are not attached to exceptions #208

Closed
@somay

Description

@somay

Issue description:

According to RFC 4512 Section 4.1.1, response controls can be attatched also to unsuccessful response messages.
But exceptions LDAPObject.result() or such raise don't have such information.
Are these any way to get response controls even if operations are not succeeded?

I'm encountering this problem when trying to interpret password policy response control from OpenLDAP 2.4 server.
Per draft-behera-ldap-password-policy Section 8.1.2.3.2, error controls such as passwordExpired are conveyed with return codes indicating operation errors.

Steps to reproduce:

  1. enable password policy overlay on OpenLDAP 2.4 server
  2. set a non-zero value to pwdMaxAge and userPassword to pwdAttribute of password policy ldap entry
  3. create an user (entry) with userPassword attribute
  4. wait for expiring
  5. call LDAPObject.simple_bind_s() on the user (which raises ldap.INVALID_CREDENTIALS)

Operating system: Linux

Python version: 3.5.2

python-ldap version: 3.0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions