mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2025-03-14 18:55:37 +00:00
allow broken no-op deny+allow room server ACL keys
Signed-off-by: June Clementine Strawberry <june@3.dog>
This commit is contained in:
parent
fe65648296
commit
2c58a6efda
1 changed files with 10 additions and 3 deletions
|
@ -14,14 +14,21 @@ pub async fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Res
|
|||
.room_state_get_content(room_id, &StateEventType::RoomServerAcl, "")
|
||||
.await
|
||||
.map(|c: RoomServerAclEventContent| c)
|
||||
.inspect(|acl| trace!("ACL content found: {acl:?}"))
|
||||
.inspect_err(|e| trace!("No ACL content found: {e:?}"))
|
||||
.inspect(|acl| trace!(%room_id, "ACL content found: {acl:?}"))
|
||||
.inspect_err(|e| trace!(%room_id, "No ACL content found: {e:?}"))
|
||||
else {
|
||||
return Ok(());
|
||||
};
|
||||
|
||||
if acl_event_content.allow.is_empty() {
|
||||
warn!("Ignoring broken ACL event (allow key is empty)");
|
||||
warn!(%room_id, "Ignoring broken ACL event (allow key is empty)");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
if acl_event_content.deny.contains(&String::from("*"))
|
||||
&& acl_event_content.allow.contains(&String::from("*"))
|
||||
{
|
||||
warn!(%room_id, "Ignoring broken ACL event (allow key and deny key both contain wildcard \"*\"");
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue