[GH-ISSUE #997] [BUG] Unable to search using multi-value attributes #364

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

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

Describe the bug

I created custom user attribute mail_alias with multiple values

{
  "name": "mail-alias",
  "attributeType": "STRING",
  "isEditable": false,
  "isList": true,
  "isVisible": true
}

Then I assigned multiple email addresses into the users.

info@example.com
admin@example.com

To Reproduce

I want to select an user containing one of the values:

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

# search result
search: 2
result: 0 Success
control: 1.2.840.113556.1.4.319 false MAUCAQAEAA==
pagedresults: cookie=

# numResponses: 1

After I remove 1 of the values and list contains only 1 element it works. However the mail-alias value is not in the results.

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

# test, people, example.com
dn: uid=test,ou=people,dc=example,dc=com
objectclass: inetOrgPerson
objectclass: posixAccount
objectclass: mailAccount
objectclass: person
uid: test
mail: test@example.com
createtimestamp: 2024-10-13T11:04:32.598982545+00:00
entryuuid: e5ed598e-57da-3c71-adbd-fe4261bdf4a4

# search result
search: 2
result: 0 Success
control: 1.2.840.113556.1.4.319 false MAUCAQEEAA==
pagedresults: estimate=1 cookie=

# numResponses: 2
# numEntries: 1

Expected behavior

I want to search for user containing email in mail-alias list.

Originally created by @ggodlewski on GitHub (Oct 13, 2024). Original GitHub issue: https://github.com/lldap/lldap/issues/997 **Describe the bug** I created custom user attribute `mail_alias` with multiple values ``` { "name": "mail-alias", "attributeType": "STRING", "isEditable": false, "isList": true, "isVisible": true } ``` Then I assigned multiple email addresses into the users. ``` info@example.com admin@example.com ``` **To Reproduce** I want to select an user containing one of the values: ``` ldapsearch -x -b "ou=people,dc=example,dc=com" -H ldap://localhost:3890 -D cn=admin,ou=people,dc=example,dc=com -W "mail-alias=info@example.com" Enter LDAP Password: # extended LDIF # # LDAPv3 # base <ou=people,dc=example,dc=com> with scope subtree # filter: mail-alias=info@example.com # requesting: ALL # # search result search: 2 result: 0 Success control: 1.2.840.113556.1.4.319 false MAUCAQAEAA== pagedresults: cookie= # numResponses: 1 ``` After I remove 1 of the values and list contains only 1 element it works. However the `mail-alias` value is not in the results. ``` ldapsearch -x -b "ou=people,dc=example,dc=com" -H ldap://localhost:3890 -D cn=admin,ou=people,dc=example,dc=com -W "mail-alias=info@example.com" Enter LDAP Password: # extended LDIF # # LDAPv3 # base <ou=people,dc=example,dc=com> with scope subtree # filter: mail-alias=info@example.com # requesting: ALL # # test, people, example.com dn: uid=test,ou=people,dc=example,dc=com objectclass: inetOrgPerson objectclass: posixAccount objectclass: mailAccount objectclass: person uid: test mail: test@example.com createtimestamp: 2024-10-13T11:04:32.598982545+00:00 entryuuid: e5ed598e-57da-3c71-adbd-fe4261bdf4a4 # search result search: 2 result: 0 Success control: 1.2.840.113556.1.4.319 false MAUCAQEEAA== pagedresults: estimate=1 cookie= # numResponses: 2 # numEntries: 1 ``` **Expected behavior** I want to search for user containing email in `mail-alias` list.
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):

That's a known limitation of LLDAP.
The common workaround is to have mail-alias1, mail-alias2 and so on as single value attributes

<!-- gh-comment-id:2408958054 --> @nitnelave commented on GitHub (Oct 13, 2024): That's a known limitation of LLDAP. The common workaround is to have `mail-alias1`, `mail-alias2` and so on as single value attributes
Author
Owner

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

You might also be interested in https://github.com/lldap/lldap/issues/995 explaining why the mail alias was not part of the response (you have to request the attribute explicitly)

<!-- gh-comment-id:2408958566 --> @nitnelave commented on GitHub (Oct 13, 2024): You might also be interested in https://github.com/lldap/lldap/issues/995 explaining why the mail alias was not part of the response (you have to request the attribute explicitly)
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#364
No description provided.