Skip to content

Commit

Permalink
Accept non-privileged IQs from XEP-0356 privileged components.
Browse files Browse the repository at this point in the history
mod_privilege current drops any non-privileged IQ received from a component
with an error about it not being properly wrapped. While this might
represent a mistake on the part of the component, it means that well-
behaved components can no longer send non-privileged IQs (something they
normally can do if mod_privilege isn't enabled).

Since mod_privilege is intended to grant additional permissions, and not
remove existing ones, route non-privileged IQs received from the component
normally, the same way we do with roster-query packets. The roster-query
and privilege-iq checks are both last in get_iq_encapsulated_details(), so
those checks don't bypass any other checks by short-circuiting; all we have
to do is not drop the packet.
  • Loading branch information
mtstickney committed Jan 18, 2025
1 parent 6e4ac0c commit 5631304
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mod_privilege.erl
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ component_send_packet({#iq{from = From,
drop;
{_, {error, no_privileged_iq, _Err}} ->
?INFO_MSG("IQ not forwarded: Component tried to send not wrapped IQ stanza.", []),
drop;
IQ;
{_, {error, roster_query, _Err}} ->
IQ;
{_, {error, ErrType, _Err}} ->
Expand Down

0 comments on commit 5631304

Please sign in to comment.