From bf7664612b00dfcf84c1a03bae2b009b9f1e1d94 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Fri, 19 Apr 2019 12:23:53 +0100 Subject: Fix namedmodes exposing non-key secret parameters to outsiders. --- src/modules/m_namedmodes.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_namedmodes.cpp b/src/modules/m_namedmodes.cpp index 3c8452e7b..977ac625f 100644 --- 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(""); + if ((pm->IsParameterSecret()) && (!channel->HasUser(user)) && (!user->HasPrivPermission("channels/auspex"))) + numeric.Add("<" + mh->name + ">"); else numeric.Add(channel->GetModeParameter(mh)); } -- cgit v1.2.3