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
I am not certain if this is a bug, since I couldn't find in the docs whether search()'s return value is supposed to signal the existence of matches or something else, but still:
On Active Directory, calling search() deliberately for something with no results returns True, while the same search (again searching for something that doesn't exist) returns False on OpenLDAP. The cause seems to be this (core/connection.py:856-863):
ifisinstance(response, int): # asynchronous strategyreturn_value=responseiflog_enabled(PROTOCOL):
log(PROTOCOL, 'async SEARCH response id <%s> received via <%s>', return_value, self)
else:
return_value=Trueifself.result['type'] =='searchResDone'andlen(response) >0elseFalseifnotreturn_valueandself.result['result'] notin [RESULT_SUCCESS] andnotself.last_error:
self.last_error=self.result['description']
On line 861 return_value = True if self.result['type'] == 'searchResDone' and len(response) > 0 else False the return value is determined by the result type and the length of response. On OpenLDAP when nothing is found len(response) = 0, but Active Directory returns searchResRef objects even if no results are found, thus making len(response) > 0 --> return_value = True instead of False.
The text was updated successfully, but these errors were encountered:
I am not certain if this is a bug, since I couldn't find in the docs whether search()'s return value is supposed to signal the existence of matches or something else, but still:
On Active Directory, calling search() deliberately for something with no results returns True, while the same search (again searching for something that doesn't exist) returns False on OpenLDAP. The cause seems to be this
(core/connection.py:856-863)
:On line 861
return_value = True if self.result['type'] == 'searchResDone' and len(response) > 0 else False
the return value is determined by the result type and the length ofresponse
. On OpenLDAP when nothing is foundlen(response) = 0
, but Active Directory returnssearchResRef
objects even if no results are found, thus makinglen(response) > 0 --> return_value = True
instead of False.The text was updated successfully, but these errors were encountered: