View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001741 | Anope Stable (2.0.x series) | General | public | 2020-11-05 12:44 | 2020-11-05 12:44 |
Reporter | ivp | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | N/A |
Status | new | Resolution | open | ||
Summary | 0001741: Disable DROP command for regular users when external authentication is used | ||||
Description | When using external authentication such as m_sql_authentication, regular users shouldn't be allowed to use /msg NickServ DROP command. Quick patch is attached. Should be extended to check if external authentication is used, or some setting should be added for module ns_drop to control this behavior: https://wiki.anope.org/index.php/2.0/Modules/ns_drop | ||||
Tags | No tags attached. | ||||
|
ns_drop_patch.txt (1,651 bytes)
--- old/modules/commands/ns_drop.cpp 2019-03-31 04:13:04.000000000 +0200 +++ new/modules/commands/ns_drop.cpp 2020-11-05 11:40:21.916326875 +0100 @@ -43,7 +43,7 @@ source.Reply(ACCESS_DENIED); else if (Config->GetModule("nickserv")->Get<bool>("secureadmins", "yes") && !is_mine && na->nc->IsServicesOper()) source.Reply(_("You may not drop other Services Operators' nicknames.")); - else + else if (source.IsServicesOper()) { FOREACH_MOD(OnNickDrop, (source, na)); @@ -51,22 +51,25 @@ delete na; source.Reply(_("Nickname \002%s\002 has been dropped."), nick.c_str()); - } + } else { source.Reply(ACCESS_DENIED); } } bool OnHelp(CommandSource &source, const Anope::string &subcommand) anope_override { - this->SendSyntax(source); - source.Reply(" "); - source.Reply(_("Drops the given nick from the database. Once your nickname\n" + if (source.IsServicesOper()) { + this->SendSyntax(source); + source.Reply(" "); + source.Reply(_("Drops the given nick from the database. Once your nickname\n" "is dropped you may lose all of your access and channels that\n" "you may own. Any other user will be able to gain control of\n" "this nick.")); - if (!source.HasPriv("nickserv/drop")) - source.Reply(_("You may drop any nick within your group.")); - else - source.Reply(_("As a Services Operator, you may drop any nick.")); - + if (!source.HasPriv("nickserv/drop")) + source.Reply(_("You may drop any nick within your group.")); + else + source.Reply(_("As a Services Operator, you may drop any nick.")); + } else { + source.Reply(ACCESS_DENIED); + } return true; } }; |