inspircd

A modular C++ IRC daemon (ircd). https://www.inspircd.org/
Log | Files | Refs | README

commit bf7664612b00dfcf84c1a03bae2b009b9f1e1d94
parent 15bb93a4ead17d14958883561e6ea143f49c1a66
Author: Peter Powell <petpow@saberuk.com>
Date:   Fri, 19 Apr 2019 12:23:53 +0100

Fix namedmodes exposing non-key secret parameters to outsiders.

Diffstat:
Msrc/modules/m_namedmodes.cpp | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp @@ -38,10 +38,11 @@ static void DisplayList(LocalUser* user, Channel* channel) if (!channel->IsModeSet(mh)) continue; numeric.Add("+" + mh->name); - if (mh->NeedsParam(true)) + ParamModeBase* pm = mh->IsParameterMode(); + if (pm) { - if ((mh->name == "key") && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) - numeric.Add("<key>"); + if ((pm->IsParameterSecret()) && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) + numeric.Add("<" + mh->name + ">"); else numeric.Add(channel->GetModeParameter(mh)); }