ldap wildcard handler, error if '*' attribute makes it to get_x_attribute

This commit is contained in:
Matthew Strasiotto 2022-05-12 20:46:46 +10:00 committed by nitnelave
parent 5150d8341f
commit b7957f598b

View File

@ -120,11 +120,10 @@ fn get_user_attribute(user: &User, attribute: &str, dn: &str) -> Result<Option<V
// We ignore the operational attribute wildcard // We ignore the operational attribute wildcard
"+" => return Ok(None), "+" => return Ok(None),
"*" => { "*" => {
warn!( bail!(
"Matched {}, * should have been expanded into attribute list and * removed", "Matched {}, * should have been expanded into attribute list and * removed",
attribute attribute
); )
return Ok(None);
} }
_ => { _ => {
warn!("Ignoring unrecognized group attribute: {}", attribute); warn!("Ignoring unrecognized group attribute: {}", attribute);
@ -209,11 +208,10 @@ fn get_group_attribute(
// We ignore the operational attribute wildcard // We ignore the operational attribute wildcard
"+" => return Ok(None), "+" => return Ok(None),
"*" => { "*" => {
warn!( bail!(
"Matched {}, * should have been expanded into attribute list and * removed", "Matched {}, * should have been expanded into attribute list and * removed",
attribute attribute
); )
return Ok(None);
} }
_ => { _ => {
warn!("Ignoring unrecognized group attribute: {}", attribute); warn!("Ignoring unrecognized group attribute: {}", attribute);