From 7c9e1c5cc6a541c82b8eb141c2ccc12a3aa8b1d9 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 28 Sep 2016 20:27:04 -0400 Subject: Move CanAdd() check to after mask sanitization as it will remove other entries that are considered "covered by" the new mask --- modules/operserv/sxline.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'modules') diff --git a/modules/operserv/sxline.cpp b/modules/operserv/sxline.cpp index d461728a5..581599229 100644 --- a/modules/operserv/sxline.cpp +++ b/modules/operserv/sxline.cpp @@ -307,14 +307,15 @@ class CommandOSSNLine : public CommandOSSXLineBase if (Config->GetModule("operserv")->Get("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; - if (!this->xlm()->CanAdd(source, mask, expires, reason)) - return; - else if (mask.find_first_not_of("/.*?") == Anope::string::npos) + if (mask.find_first_not_of("/.*?") == Anope::string::npos) { source.Reply(_("\002{0}\002 coverage is too wide; please use a more specific mask."), mask); return; } + if (!this->xlm()->CanAdd(source, mask, expires, reason)) + return; + XLine *x = Serialize::New(); x->SetMask(mask); x->SetBy(source.GetNick()); @@ -518,14 +519,15 @@ class CommandOSSQLine : public CommandOSSXLineBase if (Config->GetModule("operserv")->Get("addakiller", "yes") && !source.GetNick().empty()) reason = "[" + source.GetNick() + "] " + reason; - if (!this->sqlines->CanAdd(source, mask, expires, reason)) - return; - else if (mask.find_first_not_of("./?*") == Anope::string::npos) + if (mask.find_first_not_of("./?*") == Anope::string::npos) { source.Reply(_("\002{0}\002 coverage is too wide; please use a more specific mask."), mask); return; } + if (!this->sqlines->CanAdd(source, mask, expires, reason)) + return; + XLine *x = Serialize::New(); x->SetMask(mask); x->SetBy(source.GetNick()); -- cgit