charybdis-ircd / charybdis

Scalable IRCv3.2 server for large, community-oriented networks
GNU General Public License v2.0
231 stars 102 forks source link

chmode: use NULL for priv argument when auspex:cmodes priv is not needed #364

Closed kaniini closed 4 years ago

kaniini commented 4 years ago

Commit d3fd88a406cae91cbbbdad1c0112075d004fee53 introduced sendto_channel_local_priv() as a useful refactoring of the ONLY_OPERS hack in sendto_channel_local().

This works by introducing a new priv argument, which points to a string containing either the required privileges or NULL.

The same change, however, sends an empty string as the priv argument for unprivileged modes, causing modes to not be distributed. So we change that priv argument to NULL.

Otherwise, sendto_channel_local_priv() will only distribute mode changes to opers only. This is because HasPrivilege(target_p, "") will evaluate as false due to the target not being opered.

Thanks to Devin Brown for bisecting this issue.