[GH-ISSUE #998] [BUG] Unable to search attributes containing underscore in the name #363

Closed
opened 2026-02-27 08:16:52 +03:00 by kerem · 1 comment
Owner

Originally created by @ggodlewski on GitHub (Oct 13, 2024).
Original GitHub issue: https://github.com/lldap/lldap/issues/998

To Reproduce

ldapsearch -x -b "ou=people,dc=example,dc=com" -H ldap://localhost:3890 -D cn=admin,ou=people,dc=example,dc=com -W "first_name=Grzegorz"
Enter LDAP Password: 
# extended LDIF
#
# LDAPv3
# base <ou=people,dc=example,dc=com> with scope subtree
# filter: first_name=Grzegorz
# requesting: ALL
#

ldap_search_ext: Bad search filter (-7)

Are underscores even allowed by RFC?

https://www.rfc-editor.org/rfc/rfc2251#section-4.1.4

Originally created by @ggodlewski on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/lldap/lldap/issues/998 **To Reproduce** ``` ldapsearch -x -b "ou=people,dc=example,dc=com" -H ldap://localhost:3890 -D cn=admin,ou=people,dc=example,dc=com -W "first_name=Grzegorz" Enter LDAP Password: # extended LDIF # # LDAPv3 # base <ou=people,dc=example,dc=com> with scope subtree # filter: first_name=Grzegorz # requesting: ALL # ldap_search_ext: Bad search filter (-7) ``` Are underscores even allowed by RFC? https://www.rfc-editor.org/rfc/rfc2251#section-4.1.4
kerem 2026-02-27 08:16:52 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@nitnelave commented on GitHub (Oct 13, 2024):

No: "These names MUST begin with a letter, and only contain ASCII letters, digit characters and hyphens."

In the case of first_name, you can also look for firstName (iirc), because it has an alias.
Aliases for custom attributes are only partially implemented, and definitely not in the web UI. There are plans to surface them better in the UI as well.

<!-- gh-comment-id:2408959241 --> @nitnelave commented on GitHub (Oct 13, 2024): No: "These names MUST begin with a letter, and only contain ASCII letters, digit characters and hyphens." In the case of first_name, you can also look for firstName (iirc), because it has an alias. Aliases for custom attributes are only partially implemented, and definitely not in the web UI. There are plans to surface them better in the UI as well.
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#363
No description provided.