Skip to content

Commit

Permalink
Merge d2db2b8 into fcf2716
Browse files Browse the repository at this point in the history
  • Loading branch information
jensens committed Apr 16, 2019
2 parents fcf2716 + d2db2b8 commit dc1bd9e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ History
1.0b9 (unreleased)
------------------

- Add debug-level logging if search fails with no-such-object.
[jensens]

- Fix problem with missing LDAP batching cookie in search.
[jensens]

- Remove ``smbpasswd`` dependency. Use ``passlib`` instead.
[rnix]

Expand Down
9 changes: 7 additions & 2 deletions src/node/ext/ldap/ugm/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,9 @@ def raw_search(self, criteria=None, attrlist=None,
cookie=cookie
)
except ldap.NO_SUCH_OBJECT: # pragma: no cover
logger.debug("ldap.NO_SUCH_OBJECT")
return []
if type(results) is tuple:
if isinstance(results, tuple):
results, cookie = results
if attrlist is not None:
_results = list()
Expand All @@ -630,14 +631,18 @@ def search(self, criteria=None, attrlist=None,
result = []
cookie = None
while True:
chunk, cookie = self.raw_search(
chunk_cookie = self.raw_search(
criteria=criteria,
attrlist=attrlist,
exact_match=exact_match,
or_search=or_search,
page_size=self.context.ldap_session._props.page_size,
cookie=cookie
)
if isinstance(chunk_cookie, tuple):
chunk, cookie = chunk_cookie
else:
chunk, cookie = chunk_cookie, None
result += chunk
if not cookie:
break
Expand Down

0 comments on commit dc1bd9e

Please sign in to comment.