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
If a server returns a response to a search request containing a response code that is in the range [LDAP_ERROR_MIN,LDAP_ERROR_MAX], but is not one that is actually known, then python-ldap will attempt to use NULL as an exception object, which then causes the Python runtime to raise a SystemError.
Steps to reproduce:
Perform a search against an LDAP server that returns an unknown response code. For example, OKTA (https://www.okta.com/) will return resultCode 92 (notSupported) if you attempt to perform a search using a non-trivial filter (e.g. (&(objectClass=person)(uid=foo)). Sadly, this is a proprietary solution, and the LDAP functionality doesn't appear to be generally available. However, here's the raw BER-encoded response data they send:
(resultCode 92 is in the range reserved for client-side errors, so probably shouldn't be appearing on the wire, but still).
Operating system:
Debian Stretch
Python version:
2.7.13
python-ldap version:
2.4.28
Here's a trivial patch against HEAD of master as of the time I'm writing this (363e417) that causes the base LDAPError exception to be raised in this scenario (which is more likely to be expected by client code):
Prevent ``SystemError: error return without exception set`` when LDAP
server returns an unknown LDAP result code.
Fixes: python-ldap#240
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Issue description:
If a server returns a response to a search request containing a response code that is in the range [LDAP_ERROR_MIN,LDAP_ERROR_MAX], but is not one that is actually known, then python-ldap will attempt to use NULL as an exception object, which then causes the Python runtime to raise a SystemError.
Steps to reproduce:
Perform a search against an LDAP server that returns an unknown response code. For example, OKTA (https://www.okta.com/) will return resultCode 92 (notSupported) if you attempt to perform a search using a non-trivial filter (e.g.
(&(objectClass=person)(uid=foo))
. Sadly, this is a proprietary solution, and the LDAP functionality doesn't appear to be generally available. However, here's the raw BER-encoded response data they send:or, decoded:
(resultCode 92 is in the range reserved for client-side errors, so probably shouldn't be appearing on the wire, but still).
Operating system:
Debian Stretch
Python version:
2.7.13
python-ldap version:
2.4.28
Here's a trivial patch against HEAD of master as of the time I'm writing this (363e417) that causes the base LDAPError exception to be raised in this scenario (which is more likely to be expected by client code):
The text was updated successfully, but these errors were encountered: