[BUG] (&(objectClass=person)(...)) still performs group search, logging warnings
Author: TvdWCreated Apr 1, 2026Updated Sep 11, 2026
Labelsbug
Describe the bug
LLDAP implements users and groups separately. When it receives a query filtered with objectClass=person it should only search users (get_user_list), but ends up calling get_groups_list as well, which throws warnings upon parsing the rest of the query. The end result is fine, but the warning is misleading.
To Reproduce
ldapsearch \
-H ldap://HOST:3890 \
-D "uid=admin,ou=people,dc=example,dc=com" \
-b "dc=example,dc=com" \
"(&(objectClass=person)(memberOf=cn=groupname,ou=groups,dc=example,dc=com)([email protected]))" \
-WExpected behavior
Should return the answer without warnings; it logs a warning instead.
Logs
INFO LDAP request [ 6.57ms | 0.00% / 100.00% ] session_id: a909be14-851c-41be-ae45-d3064ea7867f
DEBUG ┝━ [debug]: | msg: LdapMsg { msgid: 12, op: SearchRequest(LdapSearchRequest { base: "dc=example,dc=com", scope: Subtree, aliases: Never, sizelimit: 0, timelimit: 0, typesonly: false, filter: And([Equality("objectClass", "person"), Equality("mail", "mail"), Equality("memberOf", "cn=groupname,ou=groups,dc=example,dc=com")]), attrs: ["mail"] }), ctrl: [] }
DEBUG ┝━ do_search [ 6.57ms | 23.71% / 100.00% ]
DEBUG │ ┝━ [debug]: | request.base: "dc=example,dc=com" | scope: Global
DEBUG │ ┝━ get_user_list [ 2.94ms | 0.00% / 44.78% ]
DEBUG │ │ ┝━ [debug]: | filters: And([Equality(LowercaseEmail, "mail"), MemberOf("groupname")])
DEBUG │ │ ┕━ list_users [ 2.94ms | 44.78% ] filters: Some(And([Equality(LowercaseEmail, "mail"), MemberOf("groupname")])) | _get_groups: false
DEBUG │ │ ┕━ [debug]: | return: []
DEBUG │ ┕━ get_groups_list [ 2.07ms | 0.00% / 31.51% ]
WARN │ ┝━ [warn]: Ignoring unknown group attribute "mail" in filter.\n\
To disable this warning, add it to "ignored_group_attributes" in the config.
WARN │ ┝━ [warn]: Ignoring unknown group attribute "memberof" in filter.\n\
To disable this warning, add it to "ignored_group_attributes" in the config.
DEBUG │ ┝━ [debug]: | filters: And([False, False, False])
DEBUG │ ┕━ list_groups [ 2.07ms | 31.51% ] filters: Some(And([False, False, False]))
DEBUG │ ┕━ [debug]: | return: []
DEBUG ┕━ [debug]: | response: SearchResultDone(LdapResult { code: Success, matcheddn: "", message: "", referral: [] })Additional context
I was able to work around it by adding ou=people into the base DN, making this a very low-impact bug, but may improve the final polish of LLDAP
Source: lldap/lldap