server: fix handling of present filters

If the filter name was not in the list of attributes to return, it
wouldn't be counted as a valid attribute, meaning that the aliases of
attributes were not recognized.

Fixes #351
This commit is contained in:
Valentin Tolmer
2022-10-26 09:22:34 +02:00
committed by nitnelave
parent 201e3a93eb
commit 234cb70b97
3 changed files with 20 additions and 2 deletions

View File

@@ -163,7 +163,7 @@ fn convert_group_filter(
if field == "objectclass"
|| field == "dn"
|| field == "distinguishedname"
|| ALL_GROUP_ATTRIBUTE_KEYS.contains(&field.as_str())
|| map_group_field(field).is_some()
{
Ok(GroupRequestFilter::And(vec![]))
} else {

View File

@@ -167,7 +167,7 @@ fn convert_user_filter(ldap_info: &LdapInfo, filter: &LdapFilter) -> LdapResult<
if field == "objectclass"
|| field == "dn"
|| field == "distinguishedname"
|| ALL_USER_ATTRIBUTE_KEYS.contains(&field.as_str())
|| map_user_field(field).is_some()
{
Ok(UserRequestFilter::And(vec![]))
} else {