[GH-ISSUE #1343] [BUG] Unexpected return for ldapsearch, success instead of error #471

Closed
opened 2026-02-27 08:17:27 +03:00 by kerem · 2 comments
Owner

Originally created by @armfem on GitHub (Oct 31, 2025).
Original GitHub issue: https://github.com/lldap/lldap/issues/1343

Originally assigned to: @Copilot on GitHub.

Describe the bug
LLDAP does not return the expected return for an ldapsearch.
One of the bad effects of this is that ldap python's library can have unexpected behaviors. See the additional context for a concrete example.

To Reproduce
Steps to reproduce the behavior:

  1. Run the following command:
ldapsearch -x -H ldap://localhost:3890 -s base -b uid=bsamson,ou=people,dc=example,dc=com -D uid=admin,ou=people,dc=example,dc=com -w password "(objectClass=*)" 
  1. You get the following return from lldap:
[...]
# search result
search: 2
result: 0 Success
control: 1.2.840.113556.1.4.319 false MAUCAQAEAA==
pagedresults: cookie=

# numResponses: 1

Expected behavior
The expected behavior would be for LLDAP to return the following error:

[...]
# search result
search: 2
result: 32 No such object

# numResponses: 1

Specifically the result:32 No such object.

Additional context
For more context, I found this bug while trying to solve the following ansible issue https://github.com/ansible-collections/community.general/issues/10393

Originally created by @armfem on GitHub (Oct 31, 2025). Original GitHub issue: https://github.com/lldap/lldap/issues/1343 Originally assigned to: @Copilot on GitHub. **Describe the bug** LLDAP does not return the expected return for an ldapsearch. One of the bad effects of this is that ldap python's library can have unexpected behaviors. See the additional context for a concrete example. **To Reproduce** Steps to reproduce the behavior: 1. Run the following command: ```bash ldapsearch -x -H ldap://localhost:3890 -s base -b uid=bsamson,ou=people,dc=example,dc=com -D uid=admin,ou=people,dc=example,dc=com -w password "(objectClass=*)" ``` 2. You get the following return from lldap: ```bash [...] # search result search: 2 result: 0 Success control: 1.2.840.113556.1.4.319 false MAUCAQAEAA== pagedresults: cookie= # numResponses: 1 ``` **Expected behavior** The expected behavior would be for LLDAP to return the following error: ```bash [...] # search result search: 2 result: 32 No such object # numResponses: 1 ``` Specifically the `result:32 No such object`. **Additional context** For more context, I found this bug while trying to solve the following ansible issue https://github.com/ansible-collections/community.general/issues/10393
kerem 2026-02-27 08:17:27 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nitnelave commented on GitHub (Oct 31, 2025):

That is very much me misreading the spec and not realizing that "no result" should be an error (I still find it weird, but shrug).

This needs to be fixed indeed.

<!-- gh-comment-id:3473941733 --> @nitnelave commented on GitHub (Oct 31, 2025): That is very much me misreading the spec and not realizing that "no result" should be an error (I still find it weird, but *shrug*). This needs to be fixed indeed.
Author
Owner

@armfem commented on GitHub (Oct 31, 2025):

Glad i could help :)

I guess the error is more a security measure in case someone without enough rights is trying to poke different entries.

<!-- gh-comment-id:3474937686 --> @armfem commented on GitHub (Oct 31, 2025): Glad i could help :) I guess the error is more a security measure in case someone without enough rights is trying to poke different entries.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/lldap-lldap#471
No description provided.