diff options
author | Adam <Adam@anope.org> | 2015-12-29 14:04:45 -0500 |
---|---|---|
committer | Adam <Adam@anope.org> | 2015-12-29 14:04:45 -0500 |
commit | ac984af11af199bceeb112ec4de4d06d1b0c9ac6 (patch) | |
tree | 982acc68c4257757a1e36bbb3c9279b8e4b7eb43 /modules/commands/os_sxline.cpp | |
parent | d6cbd64621b7790bfc780138c679d53811fa13cd (diff) |
Move CanAdd() check to after mask sanitization as it will remove other entries that are considered "covered by" the new mask
Diffstat (limited to 'modules/commands/os_sxline.cpp')
-rw-r--r-- | modules/commands/os_sxline.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/modules/commands/os_sxline.cpp b/modules/commands/os_sxline.cpp index 3fde89871..eb3d570ec 100644 --- a/modules/commands/os_sxline.cpp +++ b/modules/commands/os_sxline.cpp @@ -354,9 +354,7 @@ class CommandOSSNLine : public CommandOSSXLineBase if (Config->GetModule("operserv")->Get<bool>("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(USERHOST_MASK_TOO_WIDE, mask.c_str()); return; @@ -380,6 +378,9 @@ class CommandOSSNLine : public CommandOSSXLineBase return; } + if (!this->xlm()->CanAdd(source, mask, expires, reason)) + return; + EventReturn MOD_RESULT; FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) @@ -561,9 +562,7 @@ class CommandOSSQLine : public CommandOSSXLineBase if (Config->GetModule("operserv")->Get<bool>("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(USERHOST_MASK_TOO_WIDE, mask.c_str()); return; @@ -587,6 +586,9 @@ class CommandOSSQLine : public CommandOSSXLineBase return; } + if (!this->sqlines->CanAdd(source, mask, expires, reason)) + return; + EventReturn MOD_RESULT; FOREACH_RESULT(OnAddXLine, MOD_RESULT, (source, x, this->xlm())); if (MOD_RESULT == EVENT_STOP) |